Coding actionmailer - removing garbage in the mail client

I have both text and html parts for my letters. Users report “garbage characters” in some cases where the email includes values ​​from db. The problem seems to be related to Unicode characters. I created a trivial template that simply returns a value for both text and html parts ( <%= @body_text %>) and tested it with an example string:

constant function -

When I see this line in gmail, it looks like this:

constant function

Checking the header, I see this in the mail:

Content-Type: multipart / alternative; Encoding = UTF-8 Content-Transfer-Encoding: 7bit

and then the text part:

Content-Type: text / plain; charset = UTF-8 Content-Transfer-Encoding: base64

and the html part:

Content-Type: text/html; charset = UTF-8 Content-Transfer-Encoding:

ruby ​​1.9.2, 3.2.6

+5
1

premailer-rails3 == 1.2.0. actionmailer_inline_css gem .

+1

All Articles