Pomoc - Szukaj - U¿ytkownicy - Kalendarz
Pe³na wersja: Klasa SMTP & SASL
Forum PHP.pl > Forum > Gotowe rozwi±zania
h.4
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/
Kas
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.
h.4
dalej nie wiem jak to zrobic sad.gif
Kas
Mo¿e to Ci pomo¿e http://asg.web.cmu.edu/sasl/ => Implementations
h.4
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.
To jest wersja lo-fi g³ównej zawarto¶ci. Aby zobaczyæ pe³n± wersjê z wiêksz± zawarto¶ci±, obrazkami i formatowaniem proszê kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.