PHP Check for valid email ping

0
49

PHP has a built in function called checkdnsrr() which will take an email address and check if it resolves as an IP address.

when sending emails for example,

Should checkdnsrr() return false while you are trying to send an email with this function, you can return an error informing the user that the domain probably doesn’t exist before you do anything else.

This is really nice as you didn’t really even have to validate the email address in any other way, saving you time, server resources. This is a good way to actually see of the domain and email address actually exist.

LEAVE A REPLY

Please enter your comment!
Please enter your name here