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

前端 未结 14 712
忘了有多久
忘了有多久 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:51

    Adding . before \r\n makes it work if the original string before \r\n has no .

    Other characters may work. I didn't try.

    With or without the three lines including IsBodyHtml, not a matter.

提交回复
热议问题