Skip to content

Commit

Permalink
[FIX] closes #63
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Nemry (ACSONE) committed Jul 26, 2016
1 parent 15aa39c commit dd290a0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions html_widget_embedded_picture/ir_mail_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,25 @@ def send_email(
smtp_user=smtp_user, smtp_password=smtp_password,
smtp_encryption=smtp_encryption, smtp_debug=smtp_debug,
context=context)

def build_email(
self, email_from, email_to, subject, body, email_cc=None,
email_bcc=None, reply_to=False, attachments=None, message_id=None,
references=None, object_id=False, subtype='plain', headers=None,
body_alternative=None, subtype_alternative='plain'):
"""
overwrite build_email in order to replace the header content-type
and set it to multipart/related. This modification allows a better
render into mail clients (like thunderbird)
"""
msg = super(ir_mail_server, self).build_email(
email_from, email_to, subject, body, email_cc=email_cc,
email_bcc=email_bcc, reply_to=reply_to, attachments=attachments,
message_id=message_id, references=references, object_id=object_id,
subtype=subtype, headers=headers,
body_alternative=body_alternative,
subtype_alternative=subtype_alternative)
ctype = '%s/%s' % ('multipart', 'related')
msg.replace_header('Content-Type', ctype)

return msg

0 comments on commit dd290a0

Please sign in to comment.