Changeset - f6dca275c5a8
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2011-03-22 18:10:37
marcin@python-works.com
control mailer debug with the .ini file
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -296,10 +296,11 @@ def send_email(recipients, subject, body
 
    mail_port = email_config.get('smtp_port')
 
    tls = str2bool(email_config.get('smtp_use_tls'))
 
    ssl = str2bool(email_config.get('smtp_use_ssl'))
 
    debug = str2bool(config.get('debug'))
 

	
 
    try:
 
        m = SmtpMailer(mail_from, user, passwd, mail_server,
 
                       mail_port, ssl, tls)
 
                       mail_port, ssl, tls, debug=debug)
 
        m.send(recipients, subject, body)
 
    except:
 
        log.error('Mail sending failed')
rhodecode/lib/smtp_mailer.py
Show inline comments
 
@@ -36,7 +36,7 @@ class SmtpMailer(object):
 
    """
 

	
 
    def __init__(self, mail_from, user, passwd, mail_server,
 
                    mail_port=None, ssl=False, tls=False):
 
                    mail_port=None, ssl=False, tls=False, debug=False):
 

	
 
        self.mail_from = mail_from
 
        self.mail_server = mail_server
 
@@ -45,7 +45,7 @@ class SmtpMailer(object):
 
        self.passwd = passwd
 
        self.ssl = ssl
 
        self.tls = tls
 
        self.debug = False
 
        self.debug = debug
 

	
 
    def send(self, recipients=[], subject='', body='', attachment_files=None):
 

	
0 comments (0 inline, 0 general)