PHPMailer发送邮件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>


require './class.phpmailer.php';

$mail=new PHPMailer();
$mail->ContentType="text/html";
$mail->Encoding="base64";
$mail->IsSMTP();
$mail->Host="smtp.163.com";
$mail->SMTPAuth=true;
$mail->Username="test@163.com";
$mail->Password="123456";
$mail->SetFrom("test@163.com","test");
$content=<<<EMAIL
这是一封测试的邮件,请不要做过多的关注!
EMAIL;
$mail->Subject="邮件测试";
$mail->AddAddress("test@qq.com","newMail");
$mail->Body=$content;
if($mail->Send()){
 echo "发送成功!";
}else{
 echo "发送失败!".$mail->ErrorInfo;
}