From 7ce18131ca8b1678f1bb6cb689b85707d5d58602 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 10 Mar 2009 11:06:00 +0100 Subject: [PATCH] [FIX] Set a default value if the x_headers argument has the value 'None' lp bug: https://launchpad.net/bugs/340387 fixed bzr revid: stephane@tinyerp.com-20090310100600-9lla8minamq9bq7w --- bin/tools/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 2cf387d438d..1ead9ea3a92 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -305,7 +305,6 @@ def reverse_enumerate(l): def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, tinycrm=False, ssl=False, debug=False, subtype='plain', x_headers=None): """Send an email.""" - print 'sending', email_from, email_to, subject, body import smtplib from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase @@ -315,6 +314,9 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non from email.Utils import formatdate, COMMASPACE from email import Encoders + if x_headers is None: + x_headers = {} + if not ssl: ssl = config.get('smtp_ssl', False)