Skip to content

Commit

Permalink
Fix issue jeremyephron#55
Browse files Browse the repository at this point in the history
  • Loading branch information
tornado80 committed Jul 6, 2022
1 parent e481645 commit f74262a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions simplegmail/gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,18 +884,16 @@ def _create_message(

msg_html += "<br /><br />" + 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)

Expand Down

0 comments on commit f74262a

Please sign in to comment.