Can I mark an Email as “High Importance” for Outlook using System.Net.Mail?

后端 未结 5 1950
感情败类
感情败类 2021-01-03 20:36

Part of the application I\'m working on for my client involves sending emails for events. Sometimes these are highly important. My client, and most of my client\'s clients,

5条回答
  •  清歌不尽
    2021-01-03 21:29

    Jumping in late here! Priority and Importance are not the same, but both are available to most developers to set. How do you choose? Well, Priority is defined in RFC 4021, 2.1.54, as a property that affects transmission speed and delivery ("normal", "urgent", and "non-urgent"). Importance is defined in RFC 4021, 2.1.52, as a property that is a hint from the originator to the recipients about how important a message is ("high", "normal", and "low").

    For my use case, I'm targeting Outlook users and using MimeKit to build the emails. Importance is what most email clients care about, so here's what my code might look like:

    using MimeKit;
    var message = new MimeMessage();
    message.Importance = MessageImportance.High;
    

    I'll repost Steiger's links, because he's spot-on:

    • https://www.iana.org/assignments/message-headers/message-headers.xhtml
    • https://tools.ietf.org/html/rfc4021#page-32

提交回复
热议问题