How to implement Email verification in asp.net

Posted by Saratvaddilli under ASP.NET on 11/14/2012 | Points: 10 | Views : 4218 | Status : [Member] [MVP] | Replies : 3
hi to every one ,
i want to implement email verification in my website , can any please share some info regarding this

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are



Responses

Posted by: Deepraj on: 11/14/2012 [Member] Starter | Points: 25

Up
0
Down
Can you please tell me which site you are developing?

Saratvaddilli, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Funda on: 11/14/2012 [Member] Starter | Points: 25

Up
0
Down
The below Code Snippet Steps will throw an exception, if the domain is not valid, so that you can flag that the email address is invalid.

string[] emailhost = (emailAddress.Split('@'));

string EmailHostName = emailhost [1];

IPHostEntry IPhst = Dns.Resolve(EmailHostName );
IPEndPoint endPt = new IPEndPoint(IPhst.AddressList[0], 25);
Socket s= new Socket(endPt.AddressFamily,
SocketType.Stream,ProtocolType.Tcp);
s.Connect(endPt);


More Info
http://www.codeproject.com/Articles/5189/Effective-Email-Address-Validation
*********************************************************************************************************************************************************
Suggestion :

If you want validate all social email id.... you can follow this

1) Email syntax validation.

2)Use the SmtpMail class of ASP.NET application by adding a reference of System.Web.dll library then add the System.Web.dll.
Then use this code

System.Web.Mail.SmtpMail.SmtpServer = "your server";

string to = "you@email.com";
string from = "someone@email.com";
string subject = "Email Test";
string body = "Test Body";
System.Web.Mail.SmtpMail.Send(to, from subject, body);


Use try Catch Based on the successes value you can...verify it...



Saratvaddilli, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asavasamuel on: 3/20/2013 [Member] Starter | Points: 25

Up
0
Down
Here is a good .net component to verify email addresses:
http://www.kellermansoftware.com/p-37-net-email-validation.aspx


Saratvaddilli, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response