daniloquio
daniloquio

Reputation: 3902

Line break doesn't work in MailMessage's body

I'm sending an email from ASP.NET using MailMessage and SmtpClient. I want to introduce some line breaks but none of the following worked:

sbBody is a StringBuilder wich I use at the end to set MailMessage's body: mailMessage.Body = sbBody.ToString()

What Am I missing here? I'm viewing the emails in Outlook and off course I'm setting IsBodyHtml to true.

Thanks for your time.

EDIT: Solved, it was a syntax error, </br> instead of <br/>

Upvotes: 3

Views: 2825

Answers (1)

Jim G.
Jim G.

Reputation: 15365

Your br tags are wrong. They should be written as:

<br />

Upvotes: 9

Related Questions