Skip to content

Commit

Permalink
don't try to convert attached files to MIMEText (they are already MIM…
Browse files Browse the repository at this point in the history
…EBase)
  • Loading branch information
anentropic committed Dec 11, 2013
1 parent 8ad190a commit 01aa4ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion envelopes/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ def to_mime_message(self):

for part in self._parts:
type_maj, type_min = part[0].split('/')
if type_maj == 'text' and type_min in ('html', 'plain'):
if not isinstance(part[1], MIMEBase) and type_maj == 'text' and\
type_min in ('html', 'plain'):
msg.attach(MIMEText(part[1], type_min, self._charset))
else:
msg.attach(part[1])
Expand Down

0 comments on commit 01aa4ec

Please sign in to comment.