用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 "发送成功";
}
?>
摘自 潇湘博客
上一篇: php乱码原因分析
下一篇: 摆脱萌新段位 买不到的攒机秘籍免费送