我想要做的是在vb.net中添加一个超链接到电子邮件正文.我发送电子邮件时得到的是链接是文本.这是我到目前为止所做的事情.任何帮助将非常感谢.
'Accepts two parameters - the username and password for the email client
Dim credentials As New System.Net.NetworkCredential("test@test.net", "test")
smtpClient.Credentials = credentials
Dim body, link As String
link = "http://localhost:" & partUrl & "/test.aspx?autoNum=" & autoNum
body = "Test email." & "<br/><br/>"
body += link
Dim email As New MailMessage
email.From = New MailAddress("test@test.net")
email.Body = body
email.Subject = "test Change/Request Password"
email.To.Add(New MailAddress(toAddress))
smtpClient.Send(email)
Run Code Online (Sandbox Code Playgroud)
您需要将其包含在标签中.
link = "<a href=""http://localhost:" & partUrl & "/test.aspx?autoNum=" & autoNum & """>Click here</a>"
Run Code Online (Sandbox Code Playgroud)
你需要设置
email.IsBodyHtml = true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19003 次 |
| 最近记录: |