ActionMailer Multipart messages broken for Quoted-printable

I still do not have a blog up so I will post here. May Google record
this so that others can find my answer and save themselves a couple
hours of debugging…

If you use the default encoding for multipart mime mail, ActionMailer or
TMail or something messes up your HTML tags and inserts a “3D” string
between every attribute="" so that you get tags looking like this:

You may never notice because your email program will render it anyway but it has deleterious effects on your delivery and spam ranking as this is not valid HTML. I traced the code a bit hoping to make a fix but eventually, in the course of testing, found a workaround. The workaround is to explicitly specify multipart messages per the instructions in the API for ActionMailer::Base and then Base64 encode the HTML portion of your email. (Implicit multipart and Quoted-printable for html multipart are broken) ie. content_type "multipart/alternative" part "text/plain" do |p| p.body = render_message('marketing_email.text.plain.rhtml', @body) end part "text/html" do |p| p.body = render_message('my_important_email.text.html.rhtml', @body) p.transfer_encoding = "base64" # VERY IMPORTANT end Hope this helps somebody. Best, Steven

Steven Talcott S. wrote:

I still do not have a blog up so I will post here. May Google record
this so that others can find my answer and save themselves a couple
hours of debugging…

If you use the default encoding for multipart mime mail, ActionMailer or
TMail or something messes up your HTML tags and inserts a “3D” string
between every attribute="" so that you get tags looking like this:

Is this really wrong? The = character is illegal in quoted printable,
and so must be represented as =3D

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs