如何使用rails发送“标记为重要”邮件

| 我需要您的意见,因为我不知道是否可能。 我希望应用程序发送的一些电子邮件应为“ 0”,以便最终用户在其中收到此邮件时为“ 1”,他们应该知道电子邮件的重要性。 目前,当我使用Evolution将任何电子邮件标记为“ 0”时,它将邮件主题和其他字段的颜色更改为“ 3”。     
已邀请:
其他两个答案都是正确的,但事实是,Outlook使用非标准标头来表示重要性。它称为X-Priority,因此您必须将其包含在外发邮件中。对于较旧的Outlook,您还可以包含\“ 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方法设置重要性,也可以使用一种API来设置各个标头(例如TMail)。 我不了解Ruby,所以我无法举一个例子,但是希望这可以为您指明正确的方向。     

要回复问题请先登录注册