asp.net中的电子邮件验证 [英] Email Verification in asp.net

查看:97
本文介绍了asp.net中的电子邮件验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我必须验证电子邮件地址。为此,在注册时会向候选人发送包含验证链接的电子邮件。通过单击链接,数据库将更新为已验证的电子邮件ID状态。如何通过验证链接传递候选人的用户名或其他详细信息?



我正在使用带有c#编码的asp.net。



有没有其他好的方法来实施电子邮件验证?请帮助我....



谢谢.....

解决方案

你好,



您可以使用以下代码发送电子邮件



在发送验证按钮按钮下面写下代码

 MailMessage mm =  new  MailMessage(); 
mm.To.Add( new MailAddress( yourwebsitemailchecker@gmail.com 验证请求));
mm.From = new MailAddress( yourwebsitemailid@gmail.com);
mm.Body = < a href = \ http://www.yourwebsitename.com/verificationpage.aspx?custid= + Session >点击此处验证< / a> fgdfgdfgdfgdfgdfgdfgfdg;
mm.IsBodyHtml = true ;
mm.Subject = 验证;
SmtpClient smcl = new SmtpClient();
smcl.Host = smtp.gmail.com;
smcl.Port = 587 ;
smcl.Credentials = new NetworkCredential( yourwebsitemailid@gmail.com yourmailpasswrod);
smcl.EnableSsl = true ;
smcl.Send(mm);





在上面你要检查querystring custid中的邮件检查器



那么你可以用custid mailid来检查你的网站收件箱是否已经收到邮箱

如果它存在意味着用户已经验证如果没有再发一次发送验证



我希望你理解我说的话



所有最好的


如果您只是在寻找客户端电子邮件验证 [ ^ ]可能是您开始的好地方。



http://www.asp.net/security/videos/implement-the-registration-验证模式 [ ^ ]对你也很有用。



如果你只是寻找电子邮件验证,然后一个简单的正则表达式模式就足以让您在客户端验证电子邮件 - http://msdn.microsoft.com/en-us/library/ff650303.aspx [ ^ ]。


您好



这可能有所帮助你



http://stackoverflow.com/questions/3045861/verifying-an-email-address-exist-in-c-sharp



thanx

Hi,

I have to validate the email addresses. For that an email containing verification link is sent to the candidates while registering. By clicking the link the database will be updated with the status of email id as verified. How can I pass the username or other details of the candidates through the verification link?

I am using asp.net with c# coding.

Have any other good methods to implement email verification? Kindly help me....

Thank you.....

解决方案

Hi,

You can send emails by using following code

write below code in button of send verification button

MailMessage mm = new MailMessage();
      mm.To.Add(new MailAddress("yourwebsitemailchecker@gmail.com", "Request for Verification"));
      mm.From = new MailAddress("yourwebsitemailid@gmail.com");
      mm.Body = "<a href="\"http://www.yourwebsitename.com/verificationpage.aspx?custid="+Session">click here to verify</a> fgdfgdfgdfgdfgdfgdfgfdg";
      mm.IsBodyHtml = true;
      mm.Subject = "Verification";
      SmtpClient smcl = new SmtpClient();
      smcl.Host = "smtp.gmail.com";
      smcl.Port = 587;
      smcl.Credentials = new NetworkCredential("yourwebsitemailid@gmail.com", "yourmailpasswrod");
      smcl.EnableSsl = true;
      smcl.Send(mm);



In the above you''ve to check mail checker in querystring custid

then you can check that yourwebsitemailchecker for inbox with that custid mailid
If it exists means that user verified If not follow one more send verification

I hope you understood what I said

All the Best


If you are just looking for client side email verification[^] might be a good place for you to start.

http://www.asp.net/security/videos/implement-the-registration-verification-pattern[^] could be useful to you as well.

If you are just looking for email validation, then a simple regex pattern would be sufficient for you to validate the email on the client side - http://msdn.microsoft.com/en-us/library/ff650303.aspx[^].


Hi

This May be help you

http://stackoverflow.com/questions/3045861/verifying-an-email-address-exist-in-c-sharp

thanx


这篇关于asp.net中的电子邮件验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆