Page 1 of 1

How to check emailaddress is exists / not?

Posted: Sat Jul 29, 2006 1:22 am
by php-pandit
Hello,


What is the simplest way and how to check whether a given email address (or domain for this email) exists?

PLZ Help me out

Posted: Sat Jul 29, 2006 1:39 am
by RobertGonzalez
This question was recently asked. Have you searched the boards yet?

viewtopic.php?t=51461

Posted: Sat Jul 29, 2006 1:41 am
by dibyendrah
You can do this by checkdnsrr function.

Code: Select all

// take a given email address and split it into the username and domain.
list($userName, $mailDomain) = split("@", $email);
if (checkdnsrr($mailDomain, "MX")) {
  // this is a valid email domain!
}
else {
  // this email domain doesn't exist!
}
Cheers,
Dibyendra