How to send email in richtext format to Outlook?

前端 未结 3 1631
囚心锁ツ
囚心锁ツ 2021-01-05 13:47

It works great to send emails (to Outlook) in HTML format by assigning the text/html content type string like so:

using (MailMessage message = new MailMessag         


        
3条回答
  •  天涯浪人
    2021-01-05 14:19

    You can also achieve this by adding another alternate view before your calendar view as below:

    var body = AlternateView.CreateAlternateViewFromString(bodyHtml, new System.Net.Mime.ContentType("text/html"));
    mailMessage.AlternateViews.Add(body);
    

提交回复
热议问题