$mail->SMTPDebug =0;// SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP();
$mail->CharSet = "UTF-8";
$mail->Host = 'mailha.sinosafe.local';
$mail->SMTPAuth = false;
$mail->Username = 'e-policy@sinosafe.com.cn';
$mail->Password = '你的密码';
$mail->SMTPSecure ='';// PHPMailer::ENCRYPTION_SMTPS;
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->Port = 25;
$mail->setFrom('e-policy@sinosafe.com.cn');
$mail->addAddress($address);
$mail->isHTML(true);
$mail->Subject = $title;
$mail->Body = $html;
$mail->send();
echo $html;
PHPMailer发邮件,用登陆账号和密码,不是授权密码。主要是SMTPSecure 和 SMTPOptions 设置
于 2022-09-28 16:40:21 首次发布