ApplicationMailer默认来自标题而不是电子邮件地址?

时间:2016-03-16 17:54:20

标签: ruby-on-rails ruby email actionmailer mailer

default from使用电子邮件地址,但当收件人收到电子邮件时,我希望标题为“#34;直播挑战”#34;不是" livetochallenge.com"

enter image description here

class ApplicationMailer < ActionMailer::Base
  default from: "livetochallenge.com@gmail.com" #This Line Needs An Email Address to Work
  layout 'mailer'
end

Action Mailer如何使用livetochallenge.com@gmail.com发送,但显示为&#34;直播挑战&#34;?

2 个答案:

答案 0 :(得分:1)

default from: '"Live to Challenge" <livetochallenge.com@gmail.com>'

答案 1 :(得分:1)

class ApplicationMailer < ActionMailer::Base
  default from: "Live to Challenge <livetochallenge.com@gmail.com>"
  layout 'mailer'
end