dqj5046 2009-09-15 19:57
浏览 50
已采纳

PHP邮件功能中的奇怪行为,地址不存在

I recently had this issue with a client. The code read:

ini_set( "sendmail_from", "noreply@<current-domain>.com" );

// $target_email has been validated as a value username.
// $subject is a simple String.
// $message is an HTML message.
mail( $target_email, $subject, $message );

When I tested this on my machine, it worked fine. When I tested it at home, at work, on Windows 2000 (IE6), XP (four different machines, and a VirtualBox instance) (IE6 & 7, Opera 9, Firefox 3), and Vista (IE 7), as well as through Konquerer and Firefox on Ubuntu (on two different machines), it worked fine (I don't have a Mac). I had tried the website on four different networks and in three different counties. I did everything I could to break this site, and I received no error, and the email came from noreply@<current-domain>.com to the expected address promptly.

When my client tested it at his office he got an SMTP error, saying that the name noreply@<current-domain>.com does not exist and he did not receive the email. But the same lines work fine when running on my server (basic LAMP set up running PHP 5.3, they have Windows 5.2.6).

What, exactly, happened? My best guess was that this is some bizarre windows server issue, I don't have the foggiest what else it could be. Unfortunately, I was not able to see how they configured their local machines to test this theory.

  • 写回答

1条回答 默认 最新

  • dongshi8038 2009-09-15 20:03
    关注

    My guess: the clients SMTP server is configured to only relay mail for known (for example: from Active Directory) adresses and reject (rightfully, one might argue) all other 'senders'? Does the noreply address exist in the clients domain?

    Try sending a mail from a 'known' good user@clientdomain.com address, telnet to the smtp server, ... to try to narrow down the problem.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料