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

前端 未结 14 686
忘了有多久
忘了有多久 2020-12-03 02:45

If create the body property as

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

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


        
14条回答
  •  日久生厌
    2020-12-03 02:52

    The key to this is when you said

    using Outlook.

    I have had the same problem with perfectly formatted text body e-mails. It's Outlook that make trash out of it. Occasionally it is kind enough to tell you that "extra line breaks were removed". Usually it just does what it wants and makes you look stupid.

    So I put in a terse body and put my nice formatted text in an attachement. You can either do that or format the body in HTML.

提交回复
热议问题