MailMessage sent string as body without newline in outlook

前端 未结 10 846
挽巷
挽巷 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条回答
  •  Happy的楠姐
    2020-12-11 16:13

    Outlook sometimes removes newlines (it usually pops up a comment that it has done it as well), not sure exactly about the rules for when it does this but I'm fairly sure if you add a . (full stop) at the end of each line it won't remove them.

    Actually, looking at this article it seems like you can also solve it by sending the emails as HTML or RTF: Line breaks are removed in posts made in plain text format in Outlook

提交回复
热议问题