dtu72460 2011-01-14 10:13
浏览 159
已采纳

如何使用PHP ping一个SMTP服务器并检查MX记录?

How to, using PHP, ping an SMTP server and check MX records? I'm willing to write a script such as the one that can be found on http://bit.ly/z4RE

I've used aaa@mailinator.com as the test mail and this is the result in more human-readable format:

Result: Ok

Log:
MX record about mailinator.com exists.
Connection succeeded to mailinator.com SMTP.
220 mail.sogetthis.com ESMTP Postfix
> HELO verify-email.org
250 Hello
> MAIL FROM: <check@verify-email.org>
=250 OK
> RCPT TO: <aaa@mailinator.com>
=250 OK

I know that port 25 must be open on the server.

  • 写回答

3条回答 默认 最新

  • doupang1917 2011-01-14 10:21
    关注

    To get MX records corresponding to a given Internet host name you can use getmxrr:

    bool getmxrr ( string $hostname , array &$mxhosts [, array &$weight ] )
    

    To communicate with the mail server via SMTP, you can use PEAR'S Net_SMTP package.

    mixed Net_SMTP::vrfy ( string $string )
    

    The package also has methods for HELO, MAIL FROM and RCPT TO

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

报告相同问题?

悬赏问题

  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下