PHP uses SMTP class to send e-mail, PHPSMTP class e-mail
SMTP class Send mail method is simple and stable, a few lines of simple configuration can send e-mail, is not very looking forward to try it!
Here's the core code:
<?php require_once "email.class.php"; Configuration information ******************************** $smtpserver = "smtp.126.com";//SMTP Server $smtpserverport = 25;//SMTP Server Port $smtpusermail = "new2008oh@126.com"; user mailbox for//smtp server $smtpemailto = $_post[' toemail '];//sent to who $smtpuser = " New2008oh ";//smtp Server user account $smtppass =" Your mailbox password ",//SMTP server user Password $mailtitle = $_post[' title '];//message subject $mailcontent ="". $_post[' content ']."
";//message content $mailtype =" HTML ";//Message Format (html/txt), TXT for text mail//************************ configuration information **************************** $ SMTP = new SMTP ($smtpserver, $smtpserverport, True, $smtpuser, $smtppass);//A true in this indicates that authentication is used, otherwise no authentication is used. $SMTP->debug = false;//whether to display debug information sent $state = $smtp->sendmail ($smtpemailto, $smtpusermail, $mailtitle, $ Mailcontent, $mailtype); echo ""; if ($state = = "") {echo] Sorry, the message failed to send! Please check that your email address is incorrect. "; echo "Point this return"; Exit (); } echo "Congratulations! Mail sent successfully!! "; echo "Point this return"; echo "";? >
Effect Appreciation:
This article shares the method to be easy to understand, hoped can help everybody.
Here is the source code for everyone to download the address: PHP using the SMTP class for e-mail delivery
http://www.bkjia.com/PHPjc/1066504.html www.bkjia.com true http://www.bkjia.com/PHPjc/1066504.html techarticle PHP using the SMTP class to implement e-mail delivery, PHPSMTP Class E-Mail SMTP class method of sending mail is simple and stable, a few lines of simple configuration can send e-mail, is not very looking forward to try ...