【问题标题】:Getting mail for a bounced email为退回的电子邮件获取邮件
【发布时间】:2014-04-03 14:27:13
【问题描述】:

我正在使用mail() 发送电子邮件问题是如果收件人 ID 不存在,我没有收到特定电子邮件 ID 的电子邮件,我尝试了以下代码。

$email="abcdt01est@gmail.com";
$usermsg="some message here";
$subject = 'Your Account Registration Confirmation';
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";    
$headers .= "From: Our Team <team@test.com>" . "\r\n";              
$headers.="Return-Path:<my email id goes here>\r\n";
mail($email, $subject, $usermsg, $headers); 

我也试过

mail("abcdt01est@gmail.com", "subject", "body of message", "From: team@test.com", "-f<my email id>");  

【问题讨论】:

  • 所以你在给我写那些邮件?顺便说一句,我记得你总是需要使用 \r\n 作为行分隔符。
  • 说清楚你想要什么..?
  • Catch email bounce 的可能重复项
  • 我希望邮件在退回时应该转到我的电子邮件 ID,当我说退回时意味着如果收件人电子邮件 ID 不存在。

标签: php email


【解决方案1】:

PHP mail() 中的Mail 函数只通知E-Mail 已被发送服务器接受,不检查E-Mail 的实际发送状态。

如果 sendmail 配置正确,您可以检查您的邮件日志/var/log/mail.log

访问http://www.phpclasses.org/package/9-PHP-PHP-mailer-to-compose-and-send-MIME-messages.html - MIME 电子邮件消息发送:PHP 邮件程序来撰写和发送 MIME 消息。

【讨论】:

    猜你喜欢
    • 2011-12-14
    • 2015-12-19
    • 2019-05-07
    • 2011-12-04
    • 2021-11-13
    • 2020-10-19
    • 2015-05-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多