Make the same changes in to the email_send like email_send_attach

Make email send debug to False in Server Action

bzr revid: mga@tinyerp.com-20080820111804-qcrvx2n3o94yhq4u
This commit is contained in:
mga@tinyerp.com 2008-08-20 16:48:04 +05:30
parent 21d60c3889
commit 7764a2e4a8
2 changed files with 10 additions and 2 deletions

View File

@ -420,7 +420,7 @@ class actions_server(osv.osv):
body = action.message
#TODO : Apply Mail merge in to the Content of the Email
if tools.email_send_attach(user, address, subject, body, debug=True) == True:
if tools.email_send_attach(user, address, subject, body, debug=False) == True:
logger.notifyChannel('email', netsvc.LOG_INFO, 'Email successfully send to : %s' % (address))
else:
logger.notifyChannel('email', netsvc.LOG_ERROR, 'Failed to send email to : %s' % (address))

View File

@ -338,7 +338,15 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non
msg['Message-Id'] = '<'+str(time.time())+'-tinycrm-'+str(tinycrm)+'@'+socket.gethostname()+'>'
try:
s = smtplib.SMTP()
s.connect(config['smtp_server'])
if debug:
s.debuglevel = 5
if ssl:
s.ehlo()
s.starttls()
s.ehlo()
s.connect(config['smtp_server'], config['smtp_port'])
if config['smtp_user'] or config['smtp_password']:
s.login(config['smtp_user'], config['smtp_password'])
s.sendmail(email_from, flatten([email_to, email_cc, email_bcc]), msg.as_string())