This article provides a detailed analysis of the instances sent by phpmailer for yahoo Mail. For more information, see
The code is as follows:
Require_once ('../class. phpmailer. php ');
$ Mail = new PHPMailer ();
$ Body = "I finally sent the email! Haha! Goodboy!
Http://news.qq.com/a/20111115/000792.htm? Qq = 0 & ADUIN = 594873950 & ADSESSION = 1321316731 & ADTAG = CLIENT. QQ.3493 _. 0 </a> ";
// Use SMTP to send emails
$ Mail-> IsSMTP ();
// Email server
$ Mail-> Host = "smtp.mail.yahoo.com.cn ";
$ Mail-> SMTPDebug = 0;
// Use SMPT for verification
$ Mail-> SMTPAuth = true;
// SMTP-verified user name
$ Mail-> Username = "******** @ yahoo.cn ";
// SMTP Authentication secret
$ Mail-> Password = "y *********";
// Set the encoding format
$ Mail-> CharSet = "UTF-8 ";
// Set the topic
$ Mail-> Subject = "test ";
// $ Mail-> AltBody = "To view the message, please use an HTML compatible email viewer! ";
// Set the sender
$ Mail-> SetFrom ('******* @ yahoo.cn', 'test ');
// Send emails in html format
$ Mail-> MsgHTML ($ body );
// Recipient's email name
$ Mail-> AddAddress ("********** @ yahoo.com", "test"); // send an email
If (! $ Mail-> Send ()){
Echo "Mailer Error:". $ mail-> ErrorInfo;
} Else {
Echo "Message sent! ";
}