在PHP中发送电子邮件之前,如何验证SMTP凭据? [英] How to validate SMTP credentials before sending email in PHP?
问题描述
由于很难找到答案,因此我认为这可能是不可能的.如果是这样,我想确认这是不可能的.
Since it's so hard to find an answer, I'm thinking this might be impossible. If so, I'd like confirmation that it's impossible.
推荐答案
这并非不可能.
您可以自己对SMTP交互进行编程,并在SMTP协议中检查是否接受了凭据的确认.对于这种方法,您必须与SMTP服务器进行套接字级别的通信(例如,使用[PHP套接字]服务 1 ).
You can program the SMTP interaction yourself and check for confirmation in the SMTP protocol that the credentials were accepted. For that approach, you would have to do socket-level communication with the SMTP server (e.g. using the [PHP Sockets] service1).
要了解SMTP协议的工作原理,请尝试通过Telnet手动进行一次.
To learn how the SMTP protocol works, try doing that with Telnet once by hand.
http://technet.microsoft.com /en-us/library/aa995718(v=exchg.65).aspx
这篇关于在PHP中发送电子邮件之前,如何验证SMTP凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!