//2017-10-26
public function tencent_mail($address, $subject, $message)
{
$root = $_SERVER['DOCUMENT_ROOT'];
require_once( $root . '/Application/Home/Common/phpmailer/PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.exmail.qq.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = ' .com';
$mail->Password = ' 23';
$mail->setFrom(' .com', ' 商 ');
$mail->addAddress($address);
$mail->Subject = $subject;
$mail->msgHTML($message);
$result = $mail->send();
if ($result) {
return ['status' => true, 'message' => '发送成功!'];
} else {
return ['status' => false, 'message' => "邮件错误: " . $mail->ErrorInfo];
}
}
PHP phpmailer 发送邮件 腾讯邮局
最新推荐文章于 2024-04-17 22:10:26 发布