kingrichard2005
kingrichard2005

Reputation: 7289

ASP.net hyperlink in email

I'm pulling a hyperlink from a SQL db and trying to embed it in an email 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("[email protected]", "[email protected]")
        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?

Upvotes: 0

Views: 524

Answers (1)

Adamant
Adamant

Reputation: 46

EDIT: Try emailMessage.isBodyHTML property

Upvotes: 3

Related Questions