Adding an HTML prefix to EMail MIME causes some clients to show empty body
I'm trying to add an HTML part to an Email - which can be any type of MIME (probably mixed or alternative , we get it raw from GMail). Here's how we currently do it: email_copy = deepcopy(original_email) if 'Content-Type' in original_email: original_email.replace_header('Content-Type', 'multipart/mixed') else: original_email.add_header('Content-Type', 'multipart/mixed') warning_part = [MIMEText(warning_html, 'html', 'UTF-8')] original_email.set_payload(warning_part) original_email.attach(email_copy) The above snippet works well for GMail web client, GMail Android app, Outlook on Mac, etc.