|
|
|
|
73
|
try:
|
73
|
try:
|
74
|
starttls_result = self._smtp_connection.starttls()
|
74
|
starttls_result = self._smtp_connection.starttls()
|
75
|
logger.debug(self, 'SMTP start TLS result: {}'.format(starttls_result))
|
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
|
login_res = self._smtp_connection.login(self._smtp_config.login, self._smtp_config.password)
|
81
|
login_res = self._smtp_connection.login(self._smtp_config.login, self._smtp_config.password)
|
77
|
logger.debug(self, 'SMTP login result: {}'.format(login_res))
|
82
|
logger.debug(self, 'SMTP login result: {}'.format(login_res))
|
78
|
except Exception as e:
|
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
|
logger.info(self, 'Connection OK')
|
86
|
logger.info(self, 'Connection OK')
|
81
|
|
87
|
|
82
|
def disconnect(self):
|
88
|
def disconnect(self):
|