当前位置:编程学习 > php >>

用phpmailer发送HTML邮件

用phpmailer发送HTML邮件

<?php
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 ="<a href='www.zzzyk.com' target='_blank'>google</a>";

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


摘自 潇湘博客

补充:Web开发 , php ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,