OrElse
OrElse

Reputation: 9959

Sending email as html

Dim objMail As New Mail.MailMessage("[email protected]", ToEmail, "Password Reset", body)

...and the problem is that the message is sent as pure text including the <br> tags within the body

How could i send the email as html?

Upvotes: 1

Views: 257

Answers (4)

Robban
Robban

Reputation: 6802

You need to specify that the mailbody is to be sent as HTML... like this:

objMail.BodyFormat = System.Web.Mail.MailFormat.Html;

Upvotes: 0

Philip Fourie
Philip Fourie

Reputation: 116827

Have a look at MailMessage.IsBodyHtml

Upvotes: 1

Mehrdad Afshari
Mehrdad Afshari

Reputation: 421968

Easy:

objMail.IsBodyHtml = True

Upvotes: 1

Brian Henk
Brian Henk

Reputation: 643

I'm not sure how to do this in VB, but you need to set the mime-type to text/html

Upvotes: 0

Related Questions