在电子邮件中插入链接asp.net

时间:2016-06-08 16:04:33

标签: asp.net email hyperlink

我想在此代码中插入链接或href:

MailMessage mm = new MailMessage("sender@gmail.com", txtEmail.Text.Trim());
            mm.Subject = "Password Recovery";
            mm.Body = string.Format("Hi {0},<br /><br />Click on the link to change your password.<br /><br />Thank You.<br/><br/>IslandGas Team", username);
            mm.IsBodyHtml = true;

在密码一词之后,页面重定向将显示一个链接。请帮帮我。

更新:

尝试了这个,但它没有阅读aspx

mm.Body = string.Format("Hi {0},<br /><br />Click <a href='forgotpassword(link).aspx'> here</a> to change your password<br /><br />Thank You.<br/><br/>IslandGas Team", username);

2 个答案:

答案 0 :(得分:1)

只需在身体中添加hyperlink 例如:

mm.Body = "Click <a href='http://google.com'>here</a> to change your password.";

答案 1 :(得分:-1)

会是这样的,了解有关href here

的更多信息
ng-model