163 Mail phpmailer to send of instance details

  • 2020-06-19 09:54:35
  • OfStack


<?php
require_once('../class.phpmailer.php');
$mail= new PHPMailer();
$body= " I finally succeeded in sending the email! Ha ha! <br/><a>http://news.qq.com/a/20111115/000792.htm?qq=0&ADUIN=594873950&ADSESSION=1321316731&ADTAG=CLIENT.QQ.3493_.0</a>";
// using SMTP Send E-mail 
$mail->IsSMTP();
// Mail server 
$mail->Host       = "smtp.163.com";
$mail->SMTPDebug  = 0;
// use SMPT validation 
$mail->SMTPAuth   = true;
//SMTP The name of the user to verify 
$mail->Username   = "********@163.com";
//SMTP Verification secrets 
$mail->Password   = "***";
// Set 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 sender 
$mail->SetFrom('****@163.com', 'test');
// using html Format mail sending 
$mail->MsgHTML($body);
// Recipient mail name 
$mail->AddAddress("***@163.com", "test");// Send E-mail 
if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}

Related articles: