A-K
A-K

Reputation: 17080

MailMessage ignoring my line breaks

I am invoking 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 a.k.a. Environment.NewLine in the body of the message, but when I open the message in Outlook, they are not there. What am I missing?

Upvotes: 4

Views: 4144

Answers (1)

rrhartjr
rrhartjr

Reputation: 2114

Do you see the "Extra line breaks in this message were removed." message underneath the sender's address in message window?

If so, click the "Extra line breaks" message and select "Restore line breaks."

Upvotes: 7

Related Questions