1. Import the class file mail and create the object
Import (' ORG.Com.Phpmailer ');
$mail =new Phpmailer ();
2. Setting up information
$mail->issmtp (); Settings are sent using the SMTP server
$mail->host = "smtp.126.com"; Set up 126 mailbox service
$mail->smtpauth = true; Settings need to be validated
$mail->username = "kongxiangshuaihe@126.com"; Senders Use Mailboxes
$mail->password = "538567"; Set Sender Password
$mail->from = "heitiane@126.com"; Sender Mailbox
$mail->fromname = "Yi Time Net"; Sender Name
$mail->addaddress (' 666@qq.com '); Add Send Address
$mail->ishtml (TRUE); Specify HTML format support
$mail->charset= "UTF-8"; Specifying a character Set
$mail->subject = "Activate account"; Message header
$mail->body = " account has been activated, click Jump Localhost/demo.jpg";//mail content, can be tagged
3. Send message, successful return true failed False
$mail->send ();
http://www.bkjia.com/PHPjc/440153.html www.bkjia.com true http://www.bkjia.com/PHPjc/440153.html techarticle 1. Import the class file mail and create the object import (' ORG.Com.Phpmailer '); $mail =new Phpmailer (); 2. Set the information $mail-issmtp (); Set to send $mail-host = "smtp.126 ...." Using the SMTP server .