Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Klasa SMTP & SASL, help
h.4
post
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 29.06.2005

Ostrzeżenie: (0%)
-----


SMTP: http://www.phpclasses.org/browse/package/14.html
SASL: http://www.phpclasses.org/browse/package/1888.html

plik do wysylania email:

  1. <?php
  2. /*
  3.  * test_smtp.php
  4.  *
  5.  * @(#) $Header: /home/mlemos/cvsroot/smtp/test_smtp.php,v 1.13 2004/10/04 07:26:43 mlemos Exp $
  6.  *
  7.  */
  8.  
  9.     require("smtp.php");
  10.  
  11.   /* Uncomment when using SASL authentication mechanisms */
  12.     
  13.     require("sasl.php");
  14.  
  15.  
  16.     $from=getenv("USER")."@".getenv("HOSTNAME"); /* Change this to your address like "me@mydomain.com"; */
  17.     $to="krzysiek.kardasz@wp.pl";                        /* Change this to your test recipient address */
  18.  
  19.     $smtp=new smtp_class;
  20.  
  21.     $smtp->host_name="poczta.o2.pl";       /* Change this variable to the address of the SMTP server to relay, like "smtp.myisp.com" */
  22.     $smtp->localhost="localhost";       /* Your computer address */
  23.     $smtp->direct_delivery=1;           /* Set to 1 to deliver directly to the recepient SMTP server */
  24.     $smtp->timeout=10;                  /* Set to the number of seconds wait for a successful connection to the SMTP serv
    er */
  25.     $smtp->data_timeout=0;              /* Set to the number seconds wait for sending or retrieving data from the SMTP se
    rver.
  26.                                            Set to 0 to use the same defined in t
    he timeout variable */
  27.     $smtp->debug=1;                     /* Set to 1 to output the communication with the SMTP server */
  28.     $smtp->html_debug=1;                /* Set to 1 to format the debug output as HTML */
  29.     $smtp->pop3_auth_host="poczta.o2.pl";           /* Set to the POP3 authentication host if your SMTP server requires prior POP3 au
    thentication */
  30.     $smtp->user="h_4";                     /* Set to the user name if the server requires authetication */
  31.     $smtp->realm="";                    /* Set to the authetication realm, usually the authentication user e-mail domain */
  32.     $smtp->password="*********";                 /* Set to the authetication password */
  33.     $smtp->workstation="";              /* Workstation name for NTLM authentication */
  34.     $smtp->authentication_mechanism="LOGIN"; /* Specify a SASL authentication method like LOGIN, PLAIN, CRAM-MD5, NTLM, etc..
  35.                                            Leave it empty to make the class nego
    tiate if necessary */
  36.  
  37.     /*
  38.      * If you need to use the direct delivery mode and this is running under
  39.      * Windows or any other platform that does not have enabled the MX
  40.      * resolution function GetMXRR() , you need to include code that emulates
  41.      * that function so the class knows which SMTP server it should connect
  42.      * to deliver the message directly to the recipient SMTP server.
  43.      */
  44.     if($smtp->direct_delivery)
  45.     {
  46.         if(!function_exists("GetMXRR"))
  47.         {
  48.             /*
  49.             * If possible specify in this array the address of at least on local
  50.             * DNS that may be queried from your network.
  51.             */
  52.             $_NAMESERVERS=array();
  53.             include("getmxrr.php");
  54.         }
  55.         /*
  56.         * If GetMXRR function is available but it is not functional, to use
  57.         * the direct delivery mode, you may use a replacement function.
  58.         */
  59.         /*
  60.         else
  61.         {
  62.             $_NAMESERVERS=array();
  63.             if(count($_NAMESERVERS)==0)
  64.                 Unset($_NAMESERVERS);
  65.             include("rrcompat.php");
  66.             $smtp->getmxrr="_getmxrr";
  67.         }
  68.         */
  69.     }
  70.  
  71.     if($smtp->SendMessage(
  72.         $from,
  73.         array(
  74.             $to
  75.         ),
  76.         array(
  77.             "From: $from",
  78.             "To: $to",
  79.             "Subject: Testing Manuel Lemos' SMTP class",
  80.             "Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
  81.         ),
  82.         "Hello $to,nnIt is just to let you know that your SMTP class is working just
     fine.nnBye.n"
    ))
  83.         echo "Message sent to $to OK.n";
  84.     else
  85.         echo "Cound not send the message to $to.nError: ".$smtp->error."n"
  86. ?>


Do innych kont pocztowych niz wp.pl czyli np do onetu itd... email dochodzi!
Wysyłając email do WP nie dochodzi.... nie wiem jak sie ta klasa SASL poslugiwac :/

dostaje taki blad:

Kod
S 550 BLAD SPF - zobacz strone / SPF Error: Please see http://spf.pobox.com/why.html?sender=krzysiek.kardasz%40wp.pl&ip=67.19.35.164&receiver=smtp.wp.pl Jesli jestes uzytkownikiem poczta.wp.pl sprawdz poprawnosc autoryzacji SMTP / If you are a poczta.wp.pl user check SMTP configuration: http://poczta.wp.pl/autoryzacja/


Ten post edytował h.4 24.08.2005, 15:02:35


--------------------
Go to the top of the page
+Quote Post
Kas
post
Post #2





Grupa: Zarejestrowani
Postów: 425
Pomógł: 0
Dołączył: 28.05.2005
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Może to Ci trochę pomoże http://www.phpclasses.org/browse/package/1888.html lub http://www.daimi.au.dk/Manuals/perl-ldap/Authen/SASL.html.

---

Jedno się powtarza, mój błąd.

Nobody's perfect. My name's nobody.

---

Też związane z SASL: http://java.sun.com/j2se/1.5.0/docs/api/ja...entFactory.html.

Ten post edytował Kas 24.08.2005, 15:51:40


--------------------
nospor, jestem z Wami.
Alpha IT
Go to the top of the page
+Quote Post
h.4
post
Post #3





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 29.06.2005

Ostrzeżenie: (0%)
-----


dalej nie wiem jak to zrobic sad.gif


--------------------
Go to the top of the page
+Quote Post
Kas
post
Post #4





Grupa: Zarejestrowani
Postów: 425
Pomógł: 0
Dołączył: 28.05.2005
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Może to Ci pomoże http://asg.web.cmu.edu/sasl/ => Implementations


--------------------
nospor, jestem z Wami.
Alpha IT
Go to the top of the page
+Quote Post
h.4
post
Post #5





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 29.06.2005

Ostrzeżenie: (0%)
-----


Poradziłem sobie z problemem

Klasa działa na wszystkie konta pocztowe, w tym na wp oraz onet.
Emaile zwykle dochodza w ciagu od 1sec do 10minut zaleznie od konta pocztowego na jakie wysylamy w przypadku wp email dochodzi po okolo 10 min.


Link do pobrania: http://uwiktora.e9.pl/klasa.smtp_edit.by.h4.zip


BTW: Jak się czegoś bardzo chce to się w końcu to osiąga smile.gif pozdrawiam.

Ten post edytował h.4 26.08.2005, 20:33:48


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 17:46