Merge branch 'latest' of github.com:webnotes/wnframework into latest

This commit is contained in:
Rushabh Mehta 2012-02-03 13:51:25 +01:00
commit 1fec27fac7

View file

@ -210,15 +210,16 @@ class EMail:
"""
Gets a smtp connection
"""
from webnotes.utils import cint
import smtplib
sess = smtplib.SMTP(self.server, self.port or None)
sess = smtplib.SMTP(self.server.encode('utf-8'), cint(self.port) or None)
if self.use_ssl:
sess.ehlo()
sess.starttls()
sess.ehlo()
ret = sess.login(self.login, self.password)
ret = sess.login(self.login.encode('utf-8'), self.password.encode('utf-8'))
# check if logged correctly
if ret[0]!=235: