Rails ActionMailer with multiple SMTP servers

前端 未结 11 1078
一整个雨季
一整个雨季 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:57

    I'm afraid it's not doable natively.
    But you can trick it a bit by modifying the @@smtp_settings variable in the model.

    There's an article on Oreilly which explains it pretty well even though they code is not clean at all. http://broadcast.oreilly.com/2009/03/using-multiple-smtp-accounts-w.html

提交回复
热议问题