Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi CPians,

I'm trying to find either a free web service with which I can validate eMail addresses programatically or some C# code that will allow me to do it myself.

I've found a few good sites that will perform the full verification (syntax, domain, mailbox) for you but only in an interactive online fashion. Looks like the few sites that used to offer this functionality as a free web service are now moving towards paid services, which is understandable.

I would be just as happy writing something myself but I wanted to shout-out to see if anybody in CP has already tackled this somewhere before I embark on my own - a preliminary search here didn't pull up anything that grabbed my attention so please bare with me if I missed a relevant article. :)
Posted

1 solution

No specific answers, but in terms of syntax validation you can use regular expressions. You won't have to look far on the net to find stuff on this. To validate the email address is actually real, you can connect to the SMTP server which handles the account. Use an MX lookup to determine the server then look at the SMTP protocol, you basically need to send MAIL FROM: RCPT TO: commands and make sure the server doesn't complain about an unknown user.

Again, I haven't looked but I'm sure you can find stuff for this on the net.
 
Share this answer
 
Comments
clientSurfer 14-Nov-11 11:41am    
Hey thanks for answering! Yes I did already find plenty of stuff on the net about how one would go about doing this and definitely won't be too difficult in C#. I just wanted to check with CPers before reinventing a wheel - but sounds like that's what I'll be doing this afternoon... I sure appreciate you outlining the process for me here though; you gave me a nice simple breakdown of the steps involved!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900