Alex Rivera | Logout

How to create a multi line body in C# System.Net.Mail.MailMessage

Asked 2011-02-16T18:21:03.893
67

If create the body property as

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();

message.Body ="First Line \n second line";

I also tried

message.Body ="First Line" + system.environment + "second line";

Both of these were ignored when I received the message (using outlook).

Any ideas on how to get mutliple lines? I am trying to avoid html encoding so that the email will play nicer with spam filters.

thanks

Edit
Report

1 Answer

1

Try using a StringBuilder object and use the appendline method. That might work.

answered 2011-02-16T18:23:51.887

Your Answer