【www.gdgbn.com--邮件】
发送邮件处理功能页面。
mail.php
require(dirname(__FILE__)."/mail/class.phpmailer.php"); //调用 phpmailer类型,如果没有phpmailer请点击这里下载phpmailer for php5/6 下载
$array = array_unique(Get_value("mail",1));//去除重复的邮箱地址
$mail = new PHPMailer();
$count =0;
$bad =0;
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.163.com"; // smtp1.example.com;smtp2.example.comspecify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "mailangel123"; // SMTP username
$mail->Password = "*******"; // SMTP password
$mail->From = "mailangel123@163.com";
$mail->FromName = "你的好友来信";
$MailBody = "内容"
$mail->AddReplyTo("mailangel123@163.com", "澳优");
$mail->AddAddress($tmpmail,"您好!");
$mail->WordWrap = 50;
$mail->CharSet="GB2312";
//$mail->AddAttachment("/var/tmp/file.tar.gz");
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true);
$mail->Subject = "你的朋友邀请你一起合影!";
$mail->Body = $MailBody;
if(!$mail->Send())
{
$bad++;
$mail->ClearAddresses();
$mail->ClearAttachments();
}
OK就完成了哦。
?>