/**
* 发送邮件
*/
public function sendMail()
{
require_once APP_PATH.'test/class.phpmailer.php';
require_once APP_PATH.'test/smtp.php';
$mail = new \PHPMailer(true);
$mail->CharSet = "UTF-8";
$mail->SMTPSecure = "ssl";
$mail->SMTPAuth = true;
$mail->IsHTML(true);
$mail->Username = "xx@qq.com";
$mail->Password = "xx";
$mail->FromName = "xx注册码"; // 发件人名称
$mail->IsSMTP();
try {
$mail->From = "xx@qq.com";
$mail->Host = "smtp.qq.com";
$mail->Port = '465';
$mail->SMTPDebug = 2; // 调试:网页显示发送结果
$mail->Debugoutput = 'html';
$mail->AddAddress('xx@qq.com', '注册用户'); //收件人
$mail->Subject = "XX 注册码"; // 邮件标题
$html = "<p>DLOTC</p><p>您的验证码为:998877,有效期10分钟。</p><p>请为了您个人隐私安全,请勿泄露给他人。</p>";
$mail->MsgHTML($html); // 邮件内容,上面设置HTML,则可以是HTML
$b = $mail->Send();
prlog($b);
} catch (\phpmailerException $e) {
prlog($e->errorMessage(),'$e->errorMessage()');
} catch (\Exception $e) {
prlog($e->getMessage(),'$e->getMessage()');
}
}