|
@@ -73,10 +73,16 @@ class EmailSender(object):
|
73
|
73
|
try:
|
74
|
74
|
starttls_result = self._smtp_connection.starttls()
|
75
|
75
|
logger.debug(self, 'SMTP start TLS result: {}'.format(starttls_result))
|
|
76
|
+ except Exception as e:
|
|
77
|
+ logger.debug(self, 'SMTP start TLS error: {}'.format(e.__str__()))
|
|
78
|
+
|
|
79
|
+ if self._smtp_config.login:
|
|
80
|
+ try:
|
76
|
81
|
login_res = self._smtp_connection.login(self._smtp_config.login, self._smtp_config.password)
|
77
|
82
|
logger.debug(self, 'SMTP login result: {}'.format(login_res))
|
78
|
83
|
except Exception as e:
|
79
|
|
- logger.debug(self, 'SMTP start TLS error: {}'.format(e.__str__()))
|
|
84
|
+ logger.debug(self, 'SMTP login error: {}'.format(e.__str__()))
|
|
85
|
+
|
80
|
86
|
logger.info(self, 'Connection OK')
|
81
|
87
|
|
82
|
88
|
def disconnect(self):
|