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

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

    Try this

    IsBodyHtml = false,
    BodyEncoding = Encoding.UTF8,
    BodyTransferEncoding = System.Net.Mime.TransferEncoding.EightBit
    

    If you wish to stick to using \r\n

    I managed to get mine working after trying for one whole day!

提交回复
热议问题