谷歌邮箱使用PHPmileer邮箱发信小结
<?php
//gmail 发信
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('class.phpmailer.php');
//include("class.smtp.php"); //可选,会自动从class.phpmailer.php加载
$mail=new PHPMailer();
$body=file_get_contents('index.html');
$body=Strtr($body,Array("\\"=>""));
$body= eregi_replace("[\]",'',$body);
$body .= '您好我正在测试邮箱发信,请不要回复,谢谢!';
$subject='这是标题这是标题';
$mail->IsSMTP(); // 告诉程式要使用SMTP
$mail->SMTPDebug = 1; // 开启 SMTP debug 信息 (测试时使用)// 1 = 错误和消息// 2 = 只有消息
$mail->SMTPAuth = true; // 开启 SMTP 验证
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server $mail->Username = ** ; // GMAIL用户名
$mail->Password = ***.@**.**; // GMAIL密码
$mail->CharSet = "utf-8"; //加入该行代码可以防止信件内容乱码
$mail->SetFrom(***@**.**,**); //发信人邮件地址及用户名
//$mail->AddReplyTo(***@**.**,**); //回复地址及用户名
$mail->Subject = "=?UTF-8?B?".base64_encode($subject)."?= ";//使用base64编码是为了防止信件标题乱码
$mail->MsgHTML($body);
$mail->AddAddress(***@**.** , **); //接收者邮件地址及用户名
if(!$mail->Send()) {
echo "Mailer Error: ".$mail->ErrorInfo;
}else{
echo $i."<br />";
}
?>
或者只是下游的用户需要采购一下 3)可能你没有认真研究对方和积极查找联系方式,只是随便发到客户的公共邮箱 4)可能找到的只是某个母公司的子品牌网站 5)可能对方...
或者只是下游的用户需要采购一下 3)可能你没有认真研究对方和积极查找联系方式,只是随便发到客户的公共邮箱 4)可能找到的只是某个母公司的子品牌网站 5)可能对方...
热门文档