Ruby on rails 3 如何定义回复地址?
如何定义不同于Ruby on rails 3 如何定义回复地址?,ruby-on-rails-3,actionmailer,Ruby On Rails 3,Actionmailer,如何定义不同于:from的回复地址?这可能吗?有两种方法: class Notifications < ActionMailer::Base default :from => 'your_app@your_domain.com', :reply_to => 'some_other_address@your_domain.com' end 类通知'您的_app@your_domain.com', :reply_to=>“some_other”_a
:from
的回复地址?这可能吗?有两种方法:
class Notifications < ActionMailer::Base
default :from => 'your_app@your_domain.com',
:reply_to => 'some_other_address@your_domain.com'
end
类通知'您的_app@your_domain.com',
:reply_to=>“some_other”_address@your_domain.com'
结束
或:
class联系人'somebody@some_domain.com',
:from=>'您的_app@your_domain.com',
:回复某人_else@some_other_domain.com')
结束
结束
或者您可以将这两种方法混合使用。我相信有更多的方法可以做到这一点。Rails 5.2和可能的旧/新版本的解决方案: 修改文件:
config/environments/development.rb
内容包括:
Rails.application.configure do
config.action_mailer.default_options = {
reply_to: 'test@example.com'
}
end
参考资料:
傻小子,我到处都找过,但邮件方法定义:谢谢!官方文件也显示了这一点:根据这一点:他们应该匹配,否则你的邮件将被垃圾邮件软件标记。
Rails.application.configure do
config.action_mailer.default_options = {
reply_to: 'test@example.com'
}
end