SMTP:
http://www.phpclasses.org/browse/package/14.htmlSASL:
http://www.phpclasses.org/browse/package/1888.htmlplik do wysylania email:
<?php
/*
* test_smtp.php
*
* @(#) $Header: /home/mlemos/cvsroot/smtp/test_smtp.php,v 1.13 2004/10/04 07:26:43 mlemos Exp $
*
*/
require("smtp.php");
/* Uncomment when using SASL authentication mechanisms */
require("sasl.php");
$from=getenv("USER")."@".getenv("HOSTNAME"); /* Change this to your address like "me@mydomain.com"; */ $to="krzysiek.kardasz@wp.pl"; /* Change this to your test recipient address */
$smtp=new smtp_class;
$smtp->host_name="poczta.o2.pl"; /* Change this variable to the address of the SMTP server to relay, like "smtp.myisp.com" */
$smtp->localhost="localhost"; /* Your computer address */
$smtp->direct_delivery=1; /* Set to 1 to deliver directly to the recepient SMTP server */
$smtp->timeout=10; /* Set to the number of seconds wait for a successful connection to the SMTP serv
er */
$smtp->data_timeout=0; /* Set to the number seconds wait for sending or retrieving data from the SMTP se
rver.
Set to 0 to use the same defined in t
he timeout variable */
$smtp->debug=1; /* Set to 1 to output the communication with the SMTP server */
$smtp->html_debug=1; /* Set to 1 to format the debug output as HTML */
$smtp->pop3_auth_host="poczta.o2.pl"; /* Set to the POP3 authentication host if your SMTP server requires prior POP3 au
thentication */
$smtp->user="h_4"; /* Set to the user name if the server requires authetication */
$smtp->realm=""; /* Set to the authetication realm, usually the authentication user e-mail domain */
$smtp->password="*********"; /* Set to the authetication password */
$smtp->workstation=""; /* Workstation name for NTLM authentication */
$smtp->authentication_mechanism="LOGIN"; /* Specify a SASL authentication method like LOGIN, PLAIN, CRAM-MD5, NTLM, etc..
Leave it empty to make the class nego
tiate if necessary */
/*
* If you need to use the direct delivery mode and this is running under
* Windows or any other platform that does not have enabled the MX
* resolution function GetMXRR() , you need to include code that emulates
* that function so the class knows which SMTP server it should connect
* to deliver the message directly to the recipient SMTP server.
*/
if($smtp->direct_delivery)
{
if(!function_exists("GetMXRR"))
{
/*
* If possible specify in this array the address of at least on local
* DNS that may be queried from your network.
*/
include("getmxrr.php");
}
/*
* If GetMXRR function is available but it is not functional, to use
* the direct delivery mode, you may use a replacement function.
*/
/*
else
{
$_NAMESERVERS=array();
if(count($_NAMESERVERS)==0)
Unset($_NAMESERVERS);
include("rrcompat.php");
$smtp->getmxrr="_getmxrr";
}
*/
}
if($smtp->SendMessage(
$from,
$to
),
"From: $from",
"To: $to",
"Subject: Testing Manuel Lemos' SMTP class",
"Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z") ),
"Hello $to,nnIt is just to let you know that your SMTP class is working just
fine.nnBye.n"))
echo "Message sent to $to OK.n"; else
echo "Cound not send the message to $to.nError: ".$smtp->error."n" ?>
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