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

后端 未结 5 1935
感情败类
感情败类 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:12

    Set the Priority property of the mail message. Its values are Normal, Low or High.

    Very late edit: As @StefanSteiger notes, Priority is only guaranteed to work for Outlook. In the intervening 8 years since this question/answer were posted, the industry has settled on the Importance header as the preferred way to do this.

    Even later edit: The source for MailMessage makes it clear that setting the Priority actually sets three things: the XPriority header, the Priority header, and the Importance header. So using the Priority property will behave as expected in any mail client, and will set the appropriate headers.

提交回复
热议问题