How to change the mailer Content-Transfer-Encoding settings in Rails?

此生再无相见时 提交于 2019-12-05 04:21:38

I found that setting the (undocumented) transport_encoding on the Mail object works:

m = mail(...)
m.transport_encoding = "quoted-printable"
m.deliver

I could not get the documented approach of setting the Content-Transfer-Encoding via ActionMailer to work.

My environment: rails (3.1), mail (~> 2.3.3)

If you use a custom mailer class, you can set it as a default option in your mailer class, as described in the documentation of ActionMailer::Base

class Notifier < ApplicationMailer
  default 'Content-Transfer-Encoding' => '7bit'
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!