简体   繁体   English

如何在codeigniter中检查电子邮件是否为假地址? (我使用过PHPMailer)

[英]How to check the email is fake address in codeigniter ? (I used PHPMailer)

Can we check if the email is sent to the fake address in CodeIgniter? 我们可以检查电子邮件是否发送到CodeIgniter中的假地址吗? I used PHPMailer, it always returns true. 我使用PHPMailer,它始终返回true。 Or there is another config in PHPMailer that I don't know. 或者我不知道PHPMailer中还有另一个配置。

PHPMailer automatically applies strict validation to all email addresses you provide, before it uses them. PHPMailer在使用您提供的所有电子邮件地址之前,会自动对其进行严格验证。

There are a few checks you can do outside of that, for example check that the domain exists at all. 除此以外,您还可以进行一些检查,例如,检查域是否存在。 PHPMailer only returns a success value if it successfully submits a message - but if you're using the default mail() mailer, it will always succeed because PHPMailer is not involved with the final delivery of the message, only the submission of it. PHPMailer仅在成功提交消息后才返回成功值-但是,如果您使用默认的mail()邮件程序,则它将始终成功,因为PHPMailer不参与消息的最终传递,而仅涉及消息的提交。

You should never attempt to validate whether a message exists by connecting to a mail server, issuing an RCPT TO for the address and then dropping the connection. 您绝不要尝试通过连接到邮件服务器,为该地址发出RCPT TO并断开连接来验证消息是否存在。 ISPs are wise to this and they will use your activites to block legitimate deliveries from you in future. ISP对此很明智,将来他们会使用您的活动来阻止您的合法发货。

So, assuming the address is technically valid and the domain exists, the only way to check whether an email address is fake or not is to send it a message. 因此,假设该地址在技术上有效且该域存在,则检查电子邮件地址是否为假的唯一方法是向其发送消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM