Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line breaks ignored when sending mail as plain text

I have a text like " Hi, \r\n this is test \r\n Thanks" I am sending the mail using MailMessage class. I have set the "IsBodyHtml" property to false. The issue is that I am receiving mails without line breaks. Can you let me know what I am missing?

like image 761
Rocky Singh Avatar asked Jul 13 '11 14:07

Rocky Singh


People also ask

Why is Outlook stripping line breaks from plain text emails?

Microsoft Outlook removes line breaks in signatures for messages sent in plain text format. For the sender, the message looks normal but when displayed to the recipient, line breaks are removed so the formatting of the signature is compromised.

How do you insert a line break in plain text email?

You can insert a break into plaintext emails using {! BR()} .

How do I keep line breaks in Outlook?

You can configure Outlook to never remove such carriage returns by going to Outlook Options, Mail and then unchecking “Remove extra line breaks in plain text messages.

How do I send an email to plain text?

To send an email in plain text in Gmail, compose a message as you normally would. At the bottom of the compose window, click the three-dot menu and then click Plain text mode. This setting acts as a toggle. To de-activate plain-text mode, re-select the menu option.


2 Answers

Use Environment.NewLinemsdn instead of \r\n.

like image 153
hungryMind Avatar answered Oct 19 '22 23:10

hungryMind


This is a feature in Outlook, you can turn it off in Outlook. Go to Options - Mail - and under "Message Format" you uncheck "Remove extra line breaks in plain text messages".

Another solution is to add three spaces at the end of each line, when you send the mail. This seems to get Outlook to accept that it is not an extra line break.

like image 35
Anders Ström Avatar answered Oct 20 '22 00:10

Anders Ström