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,这是在另一台邮件服务器上工作。 –