用phpmailer发送HTML邮件
用phpmailer发送html邮件
<?php
include_once("class.phpmailer.php");;
$formmail="";
$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="";
$mail->fromname="souba激活";
$mail->sender="";
$mail->subject =$subject;
$mail->ishtml(true);
$mail->body ="<a href='www.2cto.com' target='_blank'>google</a>";
$mail->addaddress($formmail);
if(!$mail->send())
{
echo "发送失败";
}
else
{
echo "发送成功";
}
?>
摘自 潇湘博客
上一篇: 数据能多“跑腿儿” 蔬菜就会更新鲜!
下一篇: 农产品生产供应链行业的机遇与挑战