0

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

Hi All,

I have a email functionality in my asp.net Web Application, Email Addresses are taken from a database. Is it possible to check whether E-Mail address really exists OR not. How can I do it ?.. I have searched in forums and Google got some related info which says using VRFY, RCPT Commands... but I didn't understand how can those commands be used in .NET using C#.. There are some third party tools but my client will not buy those tools..

I have SMTP mail server details,, ?? Is there any way this can be achieved ?

Community
  • 1
  • 1
msbyuva
  • 3,467
  • 13
  • 63
  • 87
  • You can check if mail was recieved via Imap. Smtp wont give you such info – Stecya Feb 27 '11 at 21:17
  • Could you provide some insight into why you want to do this? people could help you solve this if they knew what you're trying to accomplish – JDPeckham Feb 27 '11 at 21:20
  • Possible duplicate: http://stackoverflow.com/questions/3883518/can-i-check-if-an-email-address-exists-using-net – Kevin Stricker Feb 27 '11 at 21:21
  • @DOK, @Mootinator.. I have seen that thread but didn't give me the required answer.. As mentioned, I am looking for a diff way than the way mentioned in the thread duplicate.. – msbyuva Feb 28 '11 at 03:50
  • @JDPeckham... I have email functionality for which I get email from the database..if the email is not active or not existing the application will blow up... so I don't want to do that and I want to check before using them in my functionality – msbyuva Feb 28 '11 at 03:52

1 Answers1

4

The only way is to open an SMTP connection and first try the VRFY, if this results in no, it does not exist, BUT if it is Yes it might only be that the server do not tell so the second step is to send the commands to send an email but after RCPT TO you abort, do not send the data command as some servers might actually send the email then even if you abort.

If it does not protest after RCPT TO you might as well try to send for real because that will then be the only way to test further, but some servers will accept the address and only fail later or even fail with a return message that will not be detected in the SMTP session at all.

So you cannot 100 % test an email without actually sending to the address and have the recipient either return the email to you or click a link to confirm the address.

David Mårtensson
  • 7,550
  • 4
  • 31
  • 47