Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 如何定义回复地址?_Ruby On Rails 3_Actionmailer - Fatal编程技术网

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