0
我正在使用删除服务器的SMTP详细信息。这是代码片段。SMTP电子邮件未发送(服务器配置有问题,因为其他服务器的代码正常)
$mail = new PHPMailer;
$mail->IsSMTP(); // Set mailer to use SMTP
$mail->Host = isset($_GET['host'])?$_GET['host']:"[email protected]";
$mail->Port = isset($_GET['port'])?$_GET['port']:"465";
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = "[email protected]";
$mail->Password = "xxx";
$mail->SMTPSecure = 'ssl';
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed' => false
)
);
$mail->SMTPDebug=2;
完美!工作得很好:) – Alpi