首頁 >後端開發 >php教程 >用phpmailer发送HTML邮件_PHP教程

用phpmailer发送HTML邮件_PHP教程

WBOY
WBOY原創
2016-07-13 17:47:471133瀏覽

用phpmailer发送HTML邮件

include_once("class.phpmailer.php");;
$formmail="381266902@qq.com";
$subject = "实验";  
$smtp="smtp.126.com";
$username="XXXXXXXX@126.com";
$password="**********";


$mail=new PHPMailer();
$mail->SMTPAuth = true;
$mail->Host=$smtp;
$mail->IsSMTP();
$mail->SMTPAuth=true;
$mail->Username=$username;
$mail->Password=$password;
$mail->From="sou_ba@126.com";
$mail->FromName="Souba激活";
$mail->Sender="sou_ba@126.com";
$mail->Subject =$subject;
$mail->IsHTML(true);
$mail->Body ="google";

$mail->AddAddress($formmail);
if(!$mail->Send())
{
echo "发送失败";
}
else
{
echo "发送成功";
}
?>


摘自 潇湘博客

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478479.htmlTechArticle用phpmailer发送HTML邮件 ?php include_once(class.phpmailer.php);; $formmail=381266902@qq.com; $subject = 实验; $smtp=smtp.126.com; $username=XXXXXXXX@126.com; $password=*****...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn