MailMessage sent string as body without newline in outlook

前端 未结 10 865
挽巷
挽巷 2020-12-11 15:44

HI, I am trying to send a simple notification using system.net.mail.mailmessage. I just pass the string as the message body. But problem is even though multi-line message be

10条回答
  •  情深已故
    2020-12-11 16:26

    Try using the verbatim operator "@" before your message:

    message.Body = 
    @"
    line1
    line 2
    line 3
    "
    

    Consider that also the distance of the text from the left margin affects on the real sistance from the email body left margin..

提交回复
热议问题