如何使用 PHP ping SMTP 服务器并检查 MX 记录?
如何使用 PHP ping SMTP 服务器并检查 MX 记录?我愿意编写一个脚本,例如可以在 http://bit.ly/z4RE
我使用过 [电子邮件受保护]
作为测试邮件,这是更易于阅读的格式的结果:
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: <[email protected]>
=250 OK
> RCPT TO: <[email protected]>
=250 OK
我知道服务器上必须打开端口 25。
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 [email protected]
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: <[email protected]>
=250 OK
> RCPT TO: <[email protected]>
=250 OK
I know that port 25 must be open on the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以通过
dns_get_record()
检索 MX 记录:我不确定“ping”SMTP 服务器是什么意思?也许发邮件?您可以使用 PEAR 的 Mail_MIME 来做到这一点。
You can retrieve the MX record via
dns_get_record()
:I'm not sure, what you mean by "pinging" an SMTP server? Maybe send mail? That you can do with PEAR's Mail_MIME.
要获取与给定 Internet 主机名对应的 MX 记录,您可以使用
getmxrr
:要通过SMTP与邮件服务器通信,可以使用PEAR的Net_SMTP包.
该软件包还具有HELO、MAIL FROM 和 RCPT TO 方法
To get MX records corresponding to a given Internet host name you can use
getmxrr
:To communicate with the mail server via SMTP, you can use PEAR'S Net_SMTP package.
The package also has methods for HELO, MAIL FROM and RCPT TO
如何获取电子邮件的 mx 主机:
如何将电子邮件发送到 gmail:
How to get mx hosts for email:
How to send email to gmail: