1
我正在使用phpmailer類來開發該功能。爲什麼我收不到收據或閱讀收據?
這是發送電子郵件和請求閱讀回執的簡單腳本。
require 'PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "******************";
$mail->ConfirmReadingTo = "[email protected]";
$mail->addCustomHeader('Return-Receipt-To',"Shailesh Chauhan <[email protected]>");
$mail->addCustomHeader('Read-Receipt-To',"Shailesh Chauhan <[email protected]>");
$mail->addCustomHeader('X-Confirm-Reading-To',"Shailesh Chauhan <[email protected]>");
$mail->addCustomHeader('Generate-Delivery-Report',"Shailesh Chauhan <[email protected]>");
$mail->addCustomHeader('Disposition-Notification-To',"Shailesh Chauhan <[email protected]>");
$mail->setFrom('[email protected]', 'Shailesh Chauhan');
$mail->addReplyTo('[email protected]');
$mail->IsHTML(true);
$mail->addAddress('[email protected]');
$mail->Subject = 'Testing For SMTP';
$mail->Body = 'Testing For SMTP Body';
if($mail->send()){
echo 'send';
}else{
echo "Mailer Error: " . $mail->ErrorInfo;
}
郵件被成功sent.But我不能接受任何讀回執
我試圖從Gmail讀取收據,但閱讀收據不支持gmail,這是在另一臺郵件服務器上工作。 –