Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting a valid html link into a string for an email

Tags:

c#

I'm building a string that will be sent over email. In the string I'd like to include a link, like so:

String mailstring = "Blah blah blah blah. Click here for more information."

and I'd like the "here" to be a link in the email, such as putting it http://madeuplink.com. I know I can put the address instead of the 'here' but I'd like to have the link be the word.

like image 847
proseidon Avatar asked Sep 06 '26 06:09

proseidon


1 Answers

You can add HTML markup. Assuming the client has HTML emails enabled, it should become a link. If you're using MailDefinition to create the email, then ensure that the IsBodyHtml property is set to true.

String mailstring = "Blah blah blah blah. Click <a href=\"http://www.example.com\">here</a> for more information."
like image 138
keyboardP Avatar answered Sep 07 '26 20:09

keyboardP