如何使用导轨发送'Mark as Important'邮件



我需要你的观点,因为我不知道这是否可能。

我希望我的应用程序发送的一些电子邮件应该是'Mark as Important',这样当最终用户在Evolution/Outlook中收到这封邮件时,他们应该知道电子邮件的重要性。

目前,当我将任何使用进化的电子邮件标记为'Mark as Important'时,它会将邮件主题和其他字段的颜色更改为red

其他两个答案都是正确的,但问题是,Outlook使用了一个非标准的标头来表示重要性。它被称为X-Priority,所以你必须将其包含在你的外发邮件中。您还可以为旧的Outlooks添加"X-MSMail-Priority:High"。


def notification
  mail({
      :to => 'email@example.com',
      :subject => 'My subject',
      :from => 'me@somewhere.com',
      'Importance' => 'high',
      'X-Priority' => '1'}) do |format|
    format.text
    format.html
  end
end
class Notifier < ActionMailer::Base
  default :from => 'no-reply@example.com',
          :return_path => 'system@example.com'
  def welcome(recipient)
    @account = recipient
    mail(:to => recipient.email_address_with_name,
         :bcc => ["bcc@example.com", "Order Watcher <watcher@example.com>"],
         :subject => "No way!",
         :importance => "High") # <======
    end
  end

MIME RFC将重要性列为可以通过MIME电子邮件发送的标头。可以使用的值有高、正常或低。若要发送具有调整后重要性的电子邮件,请使用API,该API允许您通过API方法设置重要性,或允许您设置单独的标题(如TMail)。

我不了解Ruby,所以我不能给你举个例子,但希望这能给你指明正确的方向。

最新更新