如何编写发送电子邮件的代码并忘记密码 [英] how to write code for send email and forget password

查看:61
本文介绍了如何编写发送电子邮件的代码并忘记密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编写发送电子邮件的代码并忘记密码



例如我忘了密码,一旦点击忘记密码按钮或链接并应用询问详情和意愿通过电子邮件获取详细信息如何可能请逐步回复我

how to write code for send email and forget password

for example i forget password, once click that forget password button or link and apply the asking details and will get the details through email how it is possible please reply me step by step

推荐答案

参考



< a href =http://www.aspdotnet-suresh.com/2012/11/code-for-forgot-password-in-aspnet.html> http://www.aspdotnet-suresh.com/2012/11 /code-for-forgot-password-in-aspnet.html [ ^ ]


//sending Email.
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
                msg.To.Add(TextBox1.Text);//Read user email id here
                msg.Subject = "Forgot password.";
                msg.From = new System.Net.Mail.MailAddress("autoemail@xyz.com");
                string passwrd="  "; //retrieve the password from database and assign it to password string.
                msg.Body += "Your user ID is " + TextBox1.Text+" and password is +"passwrd;
                msg.Body += "Have a great day!\n";
                msg.Body += "  \n  ";
                msg.Body += "-Team\n XYZ services!";

                System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("localhost");//replace the localhost with hosting server name.For example in case of godaddy it is "relay-hosting.secureserver.net"
                smtp.Send(msg);





快乐编码。



Happy coding.


尝试

恢复和更改密码(C#) [ ^ ]


这篇关于如何编写发送电子邮件的代码并忘记密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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