Send 163 emails using phpmailer (detailed examples)_PHP tutorial

WBOY
Release: 2016-07-21 15:03:44
Original
880 people have browsed it

Copy code The code is as follows:

require_once('../class.phpmailer.php');
$mail= new PHPMailer();
$body= "I finally successfully sent the email! Haha!
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.163.com";
$mail->SMTPDebug = 0;
//Use SMPT verification
$mail-> SMTPAuth = true;
//Username for SMTP authentication
$mail->Username = "********@163.com";
//Secret for SMTP authentication
$mail->Password = "***";
//Set encoding format
$mail->CharSet = "utf-8";
//Set theme
$mail ->Subject = "Test";
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
//Set the sender
$mail ->SetFrom('****@163.com', 'test');
//Send email in html format
$mail->MsgHTML($body);
// Recipient email name
$mail->AddAddress("***@163.com", "test");//Send email
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327810.htmlTechArticleCopy the code as follows: ?php require_once('../class.phpmailer.php'); $mail= new PHPMailer(); $body= "I finally sent the email successfully! Haha! br/ahttp://news.qq.com/a/20111115/...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!