Home  >  Article  >  Backend Development  >  Example of parsing Yahoo emails sent using phpmailer_PHP tutorial

Example of parsing Yahoo emails sent using phpmailer_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:03:46838browse

Copy code The code is as follows:

require_once('../class.phpmailer.php');
$mail= new PHPMailer();
$body= "I finally successfully sent the email! Haha! goodboy!
http://news.qq.com/a /20111115/000792.htm?qq=0&ADUIN=594873950&ADSESSION=1321316731&ADTAG=CLIENT.QQ.3493_.0";
//Send mail using SMTP
$mail->IsSMTP();
//Mail server
$mail->Host = "smtp.mail.yahoo.com.cn";
$mail->SMTPDebug = 0;
//Use SMPT verification
$mail->SMTPAuth = true;
//Username for SMTP authentication
$mail->Username = "********@yahoo.cn";
// The secret of SMTP verification
$mail->Password = "y************";
//Set the encoding format
$mail->CharSet = "utf-8" ;
//Set the theme
$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 email in html format
$mail->MsgHTML($body);
//Recipient email name
$mail->AddAddress("************@yahoo.com", "test") ;//Send mail
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327809.htmlTechArticleCopy the code as follows: ?php require_once('../class.phpmailer.php'); $mail= new PHPMailer(); $body= "I finally sent the email successfully! Haha! goodboy! br/ahttp://news.qq.com/a...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn