开发者

ASP.net hyperlink in email

开发者 https://www.devze.com 2023-01-14 20:47 出处:网络
I\'m pulling a hyperlink from a SQL db and trying to embed it in an ema开发者_运维知识库il programmatically as follows:

I'm pulling a hyperlink from a SQL db and trying to embed it in an ema开发者_运维知识库il programmatically as follows:

        Dim dv As System.Data.DataView = CType(SqlDataSource2.Select(DataSourceSelectArguments.Empty), System.Data.DataView)
        ''Add Ticket URL and comments to answers dictionary
        Dim emailMessage As New MailMessage("donotreply@myemail.com", "me@myemail.com")
        emailMessage.Body = dv.Item(0).Item(1).ToString <--Location of email

Example of data being pulled from db:

<a href=http://www.google.com>My email link</a>

I'm trying to get it to show up as a hyper link an email, but instead it displays the full html as above. I've tried HTMLDecode, but that doesn't seem to do anything. Any suggestions?


EDIT: Try emailMessage.isBodyHTML property

0

精彩评论

暂无评论...
验证码 换一张
取 消