Changeset 9306 for main/waeup.kofa/trunk/src/waeup/kofa/smtp.py
- Timestamp:
- 7 Oct 2012, 08:32:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/smtp.py
r8382 r9306 149 149 return MIMEText(text, 'plain', charset) 150 150 151 def send_mail(from_name, from_addr, rcpt_name, rcpt_addr ,151 def send_mail(from_name, from_addr, rcpt_name, rcpt_addrs, 152 152 subject, body, config=None): 153 153 """Send mail. 154 154 """ 155 155 # format message 156 rcpt_addrs = rcpt_addrs.replace(' ','').split(',') 157 body_to = '' 158 for email in rcpt_addrs: 159 body_to += '%s, ' % encode_address(email, rcpt_name) 156 160 body = encode_body(body) 157 161 body["From"] = encode_address(from_addr, from_name) 158 body["To"] = encode_address(rcpt_addr, rcpt_name)162 body["To"] = body_to.strip(', ') 159 163 body["Subject"] = encode_header_item(subject) 160 164 161 165 mailer = getUtility(IMailService) 162 result = mailer().send(from_addr, [rcpt_addr], body.as_string())166 result = mailer().send(from_addr, rcpt_addrs, body.as_string()) 163 167 return result
Note: See TracChangeset for help on using the changeset viewer.