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

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

    Today I found the same issue on a Error reporting app. I don't want to resort to HTML, to allow outlook to display the messages I had to do (assuming StringBuilder sb):

    sb.Append(" \r\n\r\n").Append("Exception Time:" + DateTime.UtcNow.ToString());

提交回复
热议问题