使用 Delphi 和 Indy 或任何其他 Delphi 组件/工具检查电子邮件是否存在
我需要检查电子邮件帐户是否存在,我需要使用 Delphi 和 Indy 来执行此操作(如果可能)
我有一个用于 ERP 系统的 Windows 数据库,我需要确保客户在系统中输入有效的电子邮件,以便我可以将他们要求的报价发送给我的客户。
我尝试使用发送命令 HELO、MAIL 和 RCPT 在 yahoo 和 google 上进行测试,但没有成功。
I need to check email accounts whether exists or not, I need to do that using Delphi and Indy (if possible)
I have a windows database for ERP system and I need to make sure that the customer enter valid email into the system so I can send to my customer the quotes they request.
I tried to test on yahoo and google using send commands HELO, MAIL and RCPT but no success.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
邮件服务器必须保护自己免受垃圾邮件发送者和其他恶意者的侵害。他们不会轻易放弃自己的秘密。邮件服务器通常被配置为将黑洞邮件发送给不存在的收件人。他们不会回复发件人说:“抱歉,该用户不存在,请重试。”
因此,如果您想验证电子邮件地址是否有人在背后,我认为唯一确定的方法是发送一封电子邮件请求回复。
Mail servers have to protect themselves against spammers and others with malicious intent. They are not going to give up their secrets easily. It is common for mail servers to be configured to black hole messages sent to non-existent recipients. They don't respond to the sender saying, "sorry, that user doesn't exist, please try again."
So, if you want to verify whether or not an e-mail address has a human behind it I think the only way to be sure is to send an e-mail requesting a response.
您必须要求客户确认他们的电子邮件地址,即输入两次以减少拼写错误,要求注册并发送激活链接等等。明确说明他们需要一个有效的电子邮件地址:如果他们向您询问报价,为什么他们要输入无效地址?但请注意,有些人可能会使用一次性电子邮件地址来保护他们的真实地址。
您无法仅询问其服务器来检查地址是否确实存在。由于大量垃圾邮件以及垃圾邮件发送者用来收集和清理其地址列表的技术,大多数服务器都设置了自我防御功能。
这就是为什么我建议“要有礼貌”。如果您理解错误,我很抱歉,我只是告诉您,如果您的应用程序表现出“类似垃圾邮件发送者”的行为(并且您以前的问题版本对您的目标不太清楚),它可能会导致您的 IP被列入黑名单。那么您在向客户发送报价时就会遇到更多麻烦。
You have to ask your customers to confirm their email address, i.e. entering it twice to reduce misspellings, asking to register and sending an activation link and so on. State explicitly they need a valid email address: if they're asking you a quote why should they enter an invalid address? But be aware some people may use disposable email addresses to protect their real ones.
You have no way to check if an address really exists just asking its server. Due to the large amount of spam and techniques implemented by spammer to harvest and clean their addresses lists, most servers are setup to defend themselves.
That's why I suggested to "be polite". I am sorry if you got it the wrong way, I was just telling you that if your application shows a "spammer-like" behaviour (and your previous version of the question was much unclearer about your aims), it can lead to your IPs being blacklisted. Then you can have much more troubles to send quotes to customers.
您可以尝试 ICS 组件,这是一个带有很好示例的开源库(请参阅 SMTPClient)。
因此,这个库或另一个库不会告诉您电子邮件帐户是否存在,因为这取决于主机回答有关不存在帐户的命令的方式。
在 ICS 中,发送命令后,您可能必须管理一个事件:
SmtpRequestDone(Sender: TObject; RqType: TSmtpRequest;ErrorCode: Word);
其中ErrorCode 是错误代码(即550)。
You may try ICS components, an open source library with good examples (see SMTPClient).
So this library or another one will not tell you if an email account exists or not because it's depending on the way the host answer to the commands about a non existent account.
In ICS, when the command have been sent you may have to manage an event :
SmtpRequestDone(Sender: TObject; RqType: TSmtpRequest;ErrorCode: Word);
Where ErrorCode is the Error code (ie 550).