Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking if an email address exists [duplicate]

Possible Duplicate:
How to check if an email address exists without sending an email?

How can you check if an email address actually exists (not just validating)? How do these guys do it: http://www.email-unlimited.com/tools/verify-email.aspx

It seems to work...

like image 365
Prabhu Avatar asked May 03 '11 17:05

Prabhu


2 Answers

The SMTP protocol has the command RCPT that receives a mailbox on the server and may return an "ok" code if that mailbox exists. Note that some servers don't do this in order to prevent spammers from scanning for valid addresses.

What email-unlimited do is the following:

  1. Use the email domain to find the SMTP server
  2. Start a session with that SMTP server and send it the command RCPT TO:
  3. End the session

If the SMTP server returns an "ok" code in step 2, then they decide that the mailbox exists.

like image 134
Elad Avatar answered Sep 29 '22 15:09

Elad


Found this at link: http://wiki.cdyne.com/index.php/CSharp_Email_Verification

  1. Open a new/existing project.
  2. In the Solution Explorer, right click the project you wish to add the service to and select "Add Web Reference." If "Add Web Reference" is not listed, select "Add Service Reference", then "Advanced", and then "Add Web Reference."
  3. Put the WSDL for Email Verification in the URL block. (ex: http://ws.cdyne.com/emailverifyws/emailverify.asmx?wsdl)
  4. Change "Web Reference Name" to something more usable, like "EmailVerify".

//Instantiate EmailVerify
EmailVerify.EmailVerify ev = new EmailVerify.EmailVerify();

//Assign ReturnValues to the VerifyEmail method and pass in: email and License Key
EmailVerify.ReturnValues rv = ev.VerifyEmail("[email protected]", "0");

//Assign ReturnValues to the VerifyEmailWithTimeout method and pass in: email, timeout, and License Key
EmailVerify.ReturnValues rvt = ev.VerifyEmailWithTimeout("[email protected]", "5", "0"); 

//Get the response for VerifyEmail (you can choose which returns to use)
Console.WriteLine(rv.ValidLicenseKey);
Console.WriteLine(rv.CorrectSyntax);
Console.WriteLine(rv.EmailDomainFound);
Console.WriteLine(rv.EmailDisposable);
Console.WriteLine(rv.DomainVerifiesEmail);
Console.WriteLine(rv.DomainAcceptsMail);
Console.WriteLine(rv.EmailVerified);
Console.WriteLine(rv.Timeout);
Console.WriteLine(rv.DomainServersDown);
Console.WriteLine(rv.GoodEmail);

//Get the response to VerifyEmailWithTimeout (only using chosen responses)
Console.WriteLine(rvt.EmailDisposable);
Console.WriteLine(rvt.DomainVerifiesEmail);
Console.WriteLine(rvt.DomainAcceptsMail);
Console.WriteLine(rvt.EmailVerified);
Console.WriteLine(rvt.Timeout);
Console.WriteLine(rvt.DomainServersDown);
Console.WriteLine(rvt.GoodEmail);
like image 31
Keerigan Avatar answered Sep 29 '22 14:09

Keerigan