Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
Placing line breaks in an email
I am using VB for my ASP.Net website. I need to include line breaks in my email. However they are not being created. They are literally displaying in the email as "<br/><br/><br/>".
Dim thisMessage As String = "Email Content" + <br/> + <br/> + <br/> + "More Email Content"
Dim mailMessage As System.Net.Mail.MailMessag
e = New System.Net.Mail.MailMessag
mailMessage.Subject = "An email"
mailMessage.Body = thisMessage
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
It would only be shown correctly if you define your MailMessage to be a html-message. if it is plain text you need to add "\r\n" instead of "<br/>"
There is a IsBodyHtml property to get the information about the body type.
this is because you are sending plain text email (the default). In this mode, replace the <br/> with environment.newline.
if you want to use <br />, switch to html mode
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent