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