Commit 0a795f8a authored by Jean-Paul Smets's avatar Jean-Paul Smets

Build message one by one

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16398 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aad71919
......@@ -364,11 +364,13 @@ class EmailDocument(File, TextDocument):
elif type(to_url) in types.StringTypes:
to_url = [to_url]
# Not efficient but clean
for recipient in to_url:
# Create the container (outer) email message.
message = MIMEMultipart()
message['Subject'] = subject
message['From'] = from_url
message['To'] = from_url # Use this temporarily - we send messages one by one
message['To'] = recipient
message['Return-Path'] = reply_url
message.preamble = 'You will not see this in a MIME-aware mail reader.\n'
......@@ -407,10 +409,8 @@ class EmailDocument(File, TextDocument):
# Send the message
if download:
return message.as_string()
return message.as_string() # Only for debugging purpose
for recipient in to_url:
message['To'] = recipient
self.MailHost.send(message.as_string())
## Compatibility layer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment