当前位置: 移动技术网 > IT编程>开发语言>PHP > 用phpmailer发送HTML邮件

用phpmailer发送HTML邮件

2019年06月19日  | 移动技术网IT编程  | 我要评论

用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 "发送成功";
}
?>


摘自 潇湘博客

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网