[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
This commit is contained in:
parent
111bd68c17
commit
7ce18131ca
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue