From f74262a5f076bf845ce4a279f6e6fa36735fe928 Mon Sep 17 00:00:00 2001 From: Amirhosein Rajabi Date: Wed, 6 Jul 2022 16:56:37 +0430 Subject: [PATCH] Fix issue #55 --- simplegmail/gmail.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/simplegmail/gmail.py b/simplegmail/gmail.py index 2c9aba7..151119b 100644 --- a/simplegmail/gmail.py +++ b/simplegmail/gmail.py @@ -884,18 +884,16 @@ def _create_message( msg_html += "

" + account_sig - attach_plain = MIMEMultipart('alternative') if attachments else msg - attach_html = MIMEMultipart('related') if attachments else msg + text_part = MIMEMultipart('alternative') if attachments else msg if msg_plain: - attach_plain.attach(MIMEText(msg_plain, 'plain')) + text_part.attach(MIMEText(msg_plain, 'plain')) if msg_html: - attach_html.attach(MIMEText(msg_html, 'html')) + text_part.attach(MIMEText(msg_html, 'html')) if attachments: - attach_plain.attach(attach_html) - msg.attach(attach_plain) + msg.attach(text_part) self._ready_message_with_attachments(msg, attachments)