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

前端 未结 14 660
忘了有多久
忘了有多久 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 03:05

    Sometimes you don't want to create a html e-mail. I solved the problem this way :

    Replace \n by \t\n

    The tab will not be shown, but the newline will work.

提交回复
热议问题