Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
Questioncheck email Pin
michaelgr125-May-10 1:22
michaelgr125-May-10 1:22 
AnswerRe: check email Pin
Sebastian T Xavier25-May-10 1:25
Sebastian T Xavier25-May-10 1:25 
GeneralRe: check email Pin
michaelgr125-May-10 1:26
michaelgr125-May-10 1:26 
GeneralRe: check email Pin
#realJSOP25-May-10 2:34
mve#realJSOP25-May-10 2:34 
AnswerRe: check email Pin
Abhinav S25-May-10 2:29
Abhinav S25-May-10 2:29 
AnswerRe: check email Pin
Ahmed Mohammed Hasan Hasan25-May-10 2:43
Ahmed Mohammed Hasan Hasan25-May-10 2:43 
GeneralRe: check email Pin
michaelgr125-May-10 3:16
michaelgr125-May-10 3:16 
AnswerRe: check email Pin
Sandesh M Patil25-May-10 3:17
Sandesh M Patil25-May-10 3:17 
There really isn't a completely reliable way. The checks you can do are these, in rough order of difficulty...

a) Check that the email address is in the correct format.

b) Parse out the server and see if you can do a DNS lookup on it.

c) Connect to the SMTP server on port 25 at the server name given in the mail address. On connection you should receive the following:

"220 smtpservername.com ESMTP"

For a further check send "HELO yourservername.com"

You should receive "250 smtpservername.com"

At this point, you at least know the user wasn't lying about the presence of an SMTP server at that address. Now you actually can ask the server whether the user exists without sending any mail. You would do it like this:

You send "MAIL FROM:<you...yourservename.com>"

And receive back "250 OK"

You send "RCPT TO:<user...smtpservername.com>"

And receive back "250 OK"

You now know that the user address exists on the server, and that the server is ready to receive mail for that user. There are various errors that might occur instead. "550 No such user" indicates the address is bad. "551 User has moved try <anotherservername.com>" indicates that the user used to have an address, but no longer does.

In reality servers behave in different ways, so you really can't infer too much. Either 550 or 551 essentially means "no such user." Additionally servers may return other errors, based on their state at the time, so if you're going to do this in a robust manner you need to handle all the possible responses. Few sites go to the trouble of implementing all this.
GeneralRe: check email Pin
michaelgr125-May-10 3:37
michaelgr125-May-10 3:37 
QuestionIssue with Calibri Fonts in Crystal Report Pin
Sebastian T Xavier24-May-10 22:57
Sebastian T Xavier24-May-10 22:57 
AnswerRe: Issue with Calibri Fonts in Crystal Report Pin
Abhinav S25-May-10 2:32
Abhinav S25-May-10 2:32 
Questionoutlook contacts Pin
michaelgr124-May-10 22:04
michaelgr124-May-10 22:04 
AnswerRe: outlook contacts Pin
Peace ON24-May-10 22:17
Peace ON24-May-10 22:17 
GeneralRe: outlook contacts Pin
michaelgr124-May-10 23:46
michaelgr124-May-10 23:46 
GeneralRe: outlook contacts Pin
Eddy Vluggen25-May-10 5:25
professionalEddy Vluggen25-May-10 5:25 
QuestionPass Parameter in Method in .NET Pin
Isaac Gordon24-May-10 21:32
Isaac Gordon24-May-10 21:32 
AnswerRe: Pass Parameter in Method in .NET Pin
Richard MacCutchan24-May-10 21:41
mveRichard MacCutchan24-May-10 21:41 
AnswerRe: Pass Parameter in Method in .NET [modified] Pin
Hristo-Bojilov24-May-10 21:42
Hristo-Bojilov24-May-10 21:42 
GeneralRe: Pass Parameter in Method in .NET Pin
Isaac Gordon24-May-10 21:59
Isaac Gordon24-May-10 21:59 
GeneralRe: Pass Parameter in Method in .NET Pin
Hristo-Bojilov24-May-10 22:12
Hristo-Bojilov24-May-10 22:12 
GeneralRe: Pass Parameter in Method in .NET Pin
Łukasz Nowakowski24-May-10 22:45
Łukasz Nowakowski24-May-10 22:45 
GeneralRe: Pass Parameter in Method in .NET Pin
Hristo-Bojilov24-May-10 22:50
Hristo-Bojilov24-May-10 22:50 
GeneralRe: Pass Parameter in Method in .NET Pin
Łukasz Nowakowski24-May-10 22:59
Łukasz Nowakowski24-May-10 22:59 
GeneralRe: Pass Parameter in Method in .NET Pin
Hristo-Bojilov24-May-10 23:06
Hristo-Bojilov24-May-10 23:06 
GeneralRe: Pass Parameter in Method in .NET Pin
Łukasz Nowakowski24-May-10 23:13
Łukasz Nowakowski24-May-10 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.