Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Encoding problem with attachments #49

jacob-carlborg opened this Issue · 4 comments

2 participants


I have an encoding problem with sending emails with attachments. This is the error I get when trying to send an email with an attachment in the Rails console:

Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT

It's working fine if I use SMTP as the delivery method. The attachment is a PDF-file, version 1.5 according to the file command in Mac OS X. I'm setting the attachment as follows:

def attach_file (name, path, mime_type = "application/pdf")
  content =
  attachments[name] = {
    mime_type: mime_type,
    content: content,
    encoding: "Base64"

@jacob-carlborg hi, what version of letter_opener are you using?


I'm using 0.1.0.


@jacob-carlborg right, there was a problem. I've just merged #48 and looks like everything works now! Could you test it against master?

@nashby nashby closed this

That worked, and attachments work as well. Awesome, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.