没有附件的电子邮件发送正常,但是当有附件时,我会在mandril上出现边界丢失错误:
{
"code": -98,
"name": "ValidationError",
"message": "Invalid raw_message: Bad multipart message - no boundary"
}
电子邮件是html(通过Mandrill呈现没有问题)并且将具有PDF附件。
对邮件的致电是:
# 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版本1.0.53和Rails 4.1.10。