我正在使用PHPmailer(简单邮件)发送电子邮件。我已添加标题,因为我想要读取emal的收据。 这是我的代码。
define(ADMINMAIL, 'test1@gmail.com');
try{
$mail = new PHPMailer();
$ConfirmReadingTo = 'kendreparesh@gmail.com';
$msPriority = 1;
$mail->AddAddress('xyz@gmail.com', 'Mr XYZ');
$mail->AddCustomHeader( 'X-pmrqc: 1' );
$mail->AddReplyTo(ADMINMAIL,"Admin");
$mail->SetFrom(ADMINMAIL, 'Admin');
$mail->FromName = "Support Team<".ADMINMAIL.">";
$mail->AddCustomHeader("X-MSMail-Priority: $msPriority" );
$mail->AddCustomHeader("Priority: $msPriority" );
$mail->addCustomHeader("Return-Receipt-To: $ConfirmReadingTo");
$mail->addCustomHeader("X-Confirm-Reading-To: $ConfirmReadingTo");
$mail->addCustomHeader("Disposition-notification-to: $ConfirmReadingTo");
$mail->ConfirmReadingTo = 'kendreparesh@gmail.com';
$mail->WordWrap = 200;
$mail->Encoding = "8bit";
$mail->CharSet = 'UTF-8';
$mail->IsHTML(true);
$mail->Subject = "Subject line ";
$mail->MsgHTML("This is email body");
$mail->Send();
} catch (Exception $e) {
echo "<br/>".$e->getMessage(); //Boring error messages from anything else!
}
如果你能看到我一直试图要求阅读收据,但没有运气:(
还有一件事,即使在垃圾邮件或垃圾邮件文件夹中,也不会收到定位到我公司地址的电子邮件。
请建议,我该怎么办?
提前感谢,
答案 0 :(得分:1)
$mail->addCustomHeader("Disposition-Notification-To: $ConfirmReadingTo");
适合我!注意资本