0

在 Outlook 中,如果您转到...

工具 > 组织 > 使用颜色(选项卡)

...您可以更改收件箱中符合条件(发送自、发送至等)的电子邮件的颜色。

有没有办法用 C# 以编程方式做到这一点?

目前,我有一个与示例类似的简单 MailMessage 对象。

我的要求是这样的:

  • 更改某人收到的电子邮件的颜色,使其看起来更紧急

我知道您也可以使用 MailPriority.High 但这还不够好。

4

2 回答 2

4

The colors are assigned by Outlook, based on the criteria the Outlook user has supplied.

You cannot influence this from the sender's perspective, other than trying to meet the criteria if those are known to you (sent from, sent to, subject containing specific words, body containing specific words, and so on), since 'color' isn't an email property.

于 2011-09-15T09:01:45.237 回答
2

详细说明 CodeCaster 的答案。

接收者确实可以根据需要配置他的电子邮件客户端。您不能将这些规则强加在您的电子邮件中,以便在它们到达收件人的电子邮件收件箱时引起注意。如果允许的话......想象一下您的收件箱的布局。

但是,如果您使用 HTML 格式的电子邮件,则可以很容易地设置电子邮件内容的样式。

例如:

var message = new MailMessage(fromEmailAddress, toEmailAddress);
message.Subject = "This is a test";
message.Body = "<h2>This is an HTML-formatted e-mail.</h2>";
message.IsBodyHtml = true;
var smtp = new SmtpClient();
smtp.Send(message);

您可以在这里找到更多信息:

http://www.4guysfromrolla.com/articles/080206-1.aspx

但是,这种方法不会为收件人收件箱中的项目着色。它只会在他阅读电子邮件时出现。然后他仍然可以在他的客户端中禁用 HTML 格式的电子邮件。

也许您想对您公司的电子邮件强制执行这样的规则?如果您使用的是 Exchange Server,那么这可能是可能的:

https://serverfault.com/questions/20950/distributing-rules-to-outlook-2003-and-2007-clients

但是如果是这样的话,你最好在 ServerFault.com 上问这个问题。

于 2011-09-15T09:07:11.733 回答