Rails ActionMailer with multiple SMTP servers

前端 未结 11 1113
一整个雨季
一整个雨季 2020-12-13 06:19

I have a need to use two different smtp servers in a Rails application. It appears that the way ActionMailer is constructed, it is not possible to have different smtp_settin

11条回答
  •  忘掉有多难
    2020-12-13 06:59

    Tried to use jkrall's option with Rails 3.2.1 but for some reason it wouldn't override default configuration, but doing:

    MyMailer.my_email.delivery_method.settings.merge!(SMTP_SETTINGS).deliver
    

    Similar to http://www.scottw.com/multiple-smtp-servers-with-action-mailer, made it work.

提交回复
热议问题