Home >Backend Development >PHP Tutorial >2013/8/29 TP Send Email <Techniques>_PHP Tutorial
1. Import the class file mail and create the object
import('ORG.Com.Phpmailer');
$mail=new PHPMailer();
2. Setting information
$mail->IsSMTP(); //Set up to use SMTP server to send
$mail->Host = "smtp.126.com"; //Set up 126 mailbox service
$mail-> ;SMTPAuth = true; /Set sender password
$mail->From = "heitiane@126.com"; // Sender's email address
$mail ->AddAddress('666@qq.com'); //Add sending address
$mail->IsHTML(true); //Specify support for html format
$mail->CharSet ="UTF-8"; //Specify character set
$mail->Subject = "Activate account"; //Mail title
$mail->Body = "Account Already activated, click to jumplocalhost/demo.jpg"; //Email content, you can add tags
3. Send email, return true if successful and false if failed
$mail->Send();
http://www.bkjia.com/PHPjc/440153.html