Convert attachments to a list if necessary.

Also corrects a typo that was apparently silenced by the bug.
This closes issue #1123
This commit is contained in:
Mathieu Clabaut
2015-12-09 14:44:42 +01:00
parent 483092787b
commit 5b90f3f532
+2 -1
View File
@@ -523,6 +523,7 @@ class Mail(object):
payload_in.attach(attachment)
else:
payload_in.attach(attachments)
attachments = [attachments]
#######################################################
# CIPHER #
@@ -779,7 +780,7 @@ class Mail(object):
attachments = attachments and [mail.Attachment(
a.my_filename,
a.my_payload,
contebt_id='<attachment-%s>' % k
content_id='<attachment-%s>' % k
) for k, a in enumerate(attachments) if not raw]
if attachments:
result = mail.send_mail(