MailMessage ignores my line breaks

I call the following code:

public static void SendMessage(string sender, string recipient,string subject,string body) { var message = new MailMessage(sender, recipient, subject, body); _smtpClient.Send(message); } 

There are line breaks in the body of the message aka Environment.NewLine, but when I open the message in Outlook, they are not there. What am I missing?

+4
source share
1 answer

You see that "extra lines in this message have been deleted." message under sender address in message box?

If so, click the "Extra Rows" message and select "Restore Line Breaks."

+6
source

Source: https://habr.com/ru/post/1344666/


All Articles