Show More
@@ -296,10 +296,11 b' def send_email(recipients, subject, body' | |||
|
296 | 296 | mail_port = email_config.get('smtp_port') |
|
297 | 297 | tls = str2bool(email_config.get('smtp_use_tls')) |
|
298 | 298 | ssl = str2bool(email_config.get('smtp_use_ssl')) |
|
299 | debug = str2bool(config.get('debug')) | |
|
299 | 300 | |
|
300 | 301 | try: |
|
301 | 302 | m = SmtpMailer(mail_from, user, passwd, mail_server, |
|
302 | mail_port, ssl, tls) | |
|
303 | mail_port, ssl, tls, debug=debug) | |
|
303 | 304 | m.send(recipients, subject, body) |
|
304 | 305 | except: |
|
305 | 306 | log.error('Mail sending failed') |
@@ -36,7 +36,7 b' class SmtpMailer(object):' | |||
|
36 | 36 | """ |
|
37 | 37 | |
|
38 | 38 | def __init__(self, mail_from, user, passwd, mail_server, |
|
39 | mail_port=None, ssl=False, tls=False): | |
|
39 | mail_port=None, ssl=False, tls=False, debug=False): | |
|
40 | 40 | |
|
41 | 41 | self.mail_from = mail_from |
|
42 | 42 | self.mail_server = mail_server |
@@ -45,7 +45,7 b' class SmtpMailer(object):' | |||
|
45 | 45 | self.passwd = passwd |
|
46 | 46 | self.ssl = ssl |
|
47 | 47 | self.tls = tls |
|
48 |
self.debug = |
|
|
48 | self.debug = debug | |
|
49 | 49 | |
|
50 | 50 | def send(self, recipients=[], subject='', body='', attachment_files=None): |
|
51 | 51 |
General Comments 0
You need to be logged in to leave comments.
Login now