Link to home
Start Free TrialLog in
Avatar of jtran007
jtran007

asked on

How to check valid email address

Hi expert,

I can send email from my c# program, but how do i know
the receiving email addres is valid?

Thks,
JT
Avatar of RiteshShah
RiteshShah
Flag of India image

well, you can probably check email address's pattern from regular expression validator or by customize javascript whether it is in right format or not, but you can't check whether email address given is exist or not. for example if I give email address r123@hotmail.com you can't go to hotmail server to check that, rather you can send an email to r123@hotmail.com and tell your user that please activate your account or proceed further from the email sent to your account.
I don't think he means validating the email address, . .
he means "how do I know if the email was delivered to the email address".

I have a C# program the loops through an email list. But if there is
a bad email address (didn't get sent) the program crashes with an error.
I haven't had the time to investigate this, but I'm guessing there
maybe is an error message that can be caught and analyzed.
I'll see if I can take another look at this.
You might want to build in functionality that collects email addresses from an email folder where you have stored good emails (not spam). If your program can read those emails and build a table of valid email addreses wit them, then you can use that table to validate emails from the C# program. You can also include emails from your addrress book.
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jtran007
jtran007

ASKER

Hi expert,

Mikemcsd: You are right. That's what I mean.

Thanks,
JT
In that case the SmtpFailedRecipientException is what you should use..
see the links ...provided in earlier post
Thanks,
JT