C# Send both HTML and Text email - most elegant?

前端 未结 6 1444
余生分开走
余生分开走 2021-01-30 23:17

Is is best practice to send both HTML and Text email?

If I only send HTML what are the dangers?

I\'m thinking something like this below from

http://johnn

6条回答
  •  轮回少年
    2021-01-30 23:36

    Sharing my experience with sending both HTML and text in one email: I have created an email message that has 2 views: text and html using C# AlternateView classes.

    What did I get?

    On Mac, tested on High Sierra: Apple Mail app was showing the Html. If the order of messages is reversed: Html - text then Apple Mail will show the text view. The conclusion: Apple Mail is using the last view as default.

    In Windows, Outlook 2010: Microsoft Outlook by default is using the Html view. The order of views in the email doesn't matter: html,text; text,html;

    If for some reason you selected a setting to show incoming messages as a text then the Html version of your email will be converted into the text by Outlook. Even so you send the text version of your email (which might be slightly different from the HTML version and was formatted to look pretty) it won't be used.

    So you don't need to send the text version of your email if you know that your clients use Outlook and Html version is selected as default.

    Mozilla Thunderbird respects your settings and shows the correct Html or text version of your email. It works correctly on Mac and in Windows

    Hope it helps

提交回复
热议问题