Can we check if the email is sent to the fake address in CodeIgniter? I used PHPMailer, it always returns true. Or there is another config in PHPMailer that I don't know.
-
before sending email, you have to validate the domain of that email. – Faiyaz Alam Jun 22 '16 at 05:08
-
Use confirmation mail. – Varun Garg Jun 22 '16 at 06:33
-
One option is to check the domain of that email is valid or not Please check the answers in the link http://stackoverflow.com/questions/19261987/how-to-check-if-email-exist-online-using-php – josdev Jun 22 '16 at 05:04
1 Answers
PHPMailer automatically applies strict validation to all email addresses you provide, before it uses them.
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.
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. ISPs are wise to this and they will use your activites to block legitimate deliveries from you in future.
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.

- 35,538
- 15
- 81
- 104