C# .NET - how to check if email address is valid?

Asked By Vladimir Peric on 01-Oct-05 12:38 PM
Is it possible to check if email address is valid, like:
1. to find server for this mail ( if there is no server, mail is not valid )
2. if server is found,  to ask server is this mail exist on this server.
or any other way?
Thanks !

You can find if a domain

Asked By Jon Wojtowicz on 01-Oct-05 07:10 PM
is valid by performing a DNS lookup on the MX records for the domain. If no records are found then the domain does not exist. To verify if a user exists you'll need to send an email to the account, at least specifying the to part of the message. If you get a bad account response you'll know it's not valid.

can do

Asked By Venkat K on 02-Oct-05 01:21 AM
in many ways
one way u can do like this:
u can send a mail to the account with some link and then verity weather he activated or not.

1 is possible, 2 is not

Asked By Noah Gray on 02-Oct-05 11:50 AM
1, just try to open a connection to the remote server on the smtp port.
2 used to be possible, but for anti-directory listing purposes, nobody supports this. When you check to see if an address is valid, the server will just say yes to anything.
Most people just check for some chars, an @ symbol, more chars, a dot, and more chars.
If it's vital, email them a confirmation link to continue.
thanks man, again
Asked By Vladimir Peric on 02-Oct-05 12:06 PM
this is what i need....
me again
Asked By Vladimir Peric on 02-Oct-05 01:00 PM
Jon, if you look at page:
http://www.schwarzl.com/mailcheck.html
they say that: ' This tool checks the domainname, the mailserver and asks the responsible mailserver if the email adress look valid to him.'
What they mean under 'asks the responsible mailserver if the email adress look valid to him'?
Sorry for bothering you, if this not changes your previous answer don't need to answer me. Thanks!
Here's a link on SMTP
Asked By Jon Wojtowicz on 02-Oct-05 01:12 PM
reply codes. http://www.greenend.org.uk/rjk/2000/05/21/smtp-replies.html
Basically after you perform the RCPT TO: and send it to the host you should expect a 250 status code. If you get a 450 or 550 status code (I think current SMTP servers use only 550) then the mailbox is invalid and it's a bad email address.
THANKS!
Asked By Vladimir Peric on 02-Oct-05 01:15 PM
now you gave me all i need!!!
Any way, i have about 4000 bad mail responses, and there is also an error 553, but almost always is 550. Thanks again!