Ruby电子邮件编码和引用可打印的内容
是否有一种直接的方式来指导TMail使用“引用可打印”编码身体? 我只看到那里的方法来解码这样的内容,而不是创建它。
您是刚刚使用TMail
,还是在ActionMailer
使用它? 看起来TMail
本身没有编码为quoted-printable
的能力。 但是,看起来ActionMailer
确实具备这种能力。
看起来TMail
允许您按如下方式设置Content-Transfer-Encoding
标头: –
mail = TMail::Mail.new mail.transfer_encoding = "quoted-printable"
但看起来这实际上并没有对身体进行编码。
您可以在此处看到ActionMailer
设置此标头。 quoted-printable
似乎是ActionMailer
的默认值。
ActionMailer
具有ActionMailer :: Quoting :: quoted_printable方法,可将主体编码为quoted-printable
。 也许你可以利用这个……?