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:
+2
-1
@@ -523,6 +523,7 @@ class Mail(object):
|
|||||||
payload_in.attach(attachment)
|
payload_in.attach(attachment)
|
||||||
else:
|
else:
|
||||||
payload_in.attach(attachments)
|
payload_in.attach(attachments)
|
||||||
|
attachments = [attachments]
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
# CIPHER #
|
# CIPHER #
|
||||||
@@ -779,7 +780,7 @@ class Mail(object):
|
|||||||
attachments = attachments and [mail.Attachment(
|
attachments = attachments and [mail.Attachment(
|
||||||
a.my_filename,
|
a.my_filename,
|
||||||
a.my_payload,
|
a.my_payload,
|
||||||
contebt_id='<attachment-%s>' % k
|
content_id='<attachment-%s>' % k
|
||||||
) for k, a in enumerate(attachments) if not raw]
|
) for k, a in enumerate(attachments) if not raw]
|
||||||
if attachments:
|
if attachments:
|
||||||
result = mail.send_mail(
|
result = mail.send_mail(
|
||||||
|
|||||||
Reference in New Issue
Block a user