1

Emails without attachment are delivered fine, but when there is an attachment I get boundary missing error on mandril:

{
"code": -98,
"name": "ValidationError",
"message": "Invalid raw_message: Bad multipart message - no boundary"
}
  • Letter opener in dev model shows the email rendering perfectly

The Email is html (rendered via Mandrill without a problem) and will have a PDF attachment.

the call to mailer is:

# template variables
merge_vars = {"AMOUNT" => "100"}

invoice = Invoice.new(customer)

attachments[invoice.name] = {
  data: invoice.invoice_data,
  mime_type: 'application/pdf'
}

content_type = "multipart/mixed"

mail(to: user.email, cc: cc_emails.compact.uniq, subject: mail_subject, content_type: content_type) do |format|
  # Template renders fine
  format.html{mandrill_template('invoice_template', merge_vars)}
end

Mandril gem version 1.0.53 and Rails 4.1.10.

nancyv233
  • 140
  • 1
  • 7
  • Have you looked at http://stackoverflow.com/questions/18419611/argumenterror-an-smtp-to-address-is-required-to-send-a-message-set-the-message – Wand Maker Aug 04 '15 at 18:28
  • Yes i did look at it. In development (using letter opener) I can see the headers and the to: field is filled in. Also when i use the console to manually trigger the email, I can see the fields all populated. – nancyv233 Aug 04 '15 at 19:01
  • Can you provide the full JSON request from your Mandrill logs, not just the error? – terrorbox Aug 05 '15 at 13:20

0 Answers0