doujiyan0031 2013-10-22 22:46
浏览 342
已采纳

确定真正的邮件发送状态(PHP mail())

I am using inbuilt support of sending mails in php.

$status=mail($to,$subject,$message,$headers,"-f $from");

I am on LAMP server and we use sendmail Unix utility. php mail() returns true status if it has handed over the mail to sendmail so we can not be sure that whether a mail has been sent successfully of not. Now what I want is to make some socket connection between php and sendmail so that I can get the "True status" whether mail has been sent or not.

I am very new for PHP. This is the part of the first problem which I am solving in PHP. I Goggled but I am not getting exactly how to proceed further. Guide me how can I get true status whether a mail has been sent or not at PHP end?

  • 写回答

2条回答 默认 最新

  • duanlei20082008 2013-10-22 22:55
    关注

    Option 1: Socket connection: read the RFC, then write a standards-compliant SMTP client program. [don't even bother unless you want to throw a few weeks of your life away]

    Option 2: Use PHPmailer or SwiftMailer or one of the other bazillion mailing libraries that have already written a standards-compliant SMTP client that will actually tell you if the mail was successfully sent or not.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?