initiate starttls if port 586

This commit is contained in:
Usman Nasir
2020-07-24 19:00:51 +05:00
parent 4cea5d7a35
commit e401b465ad

View File

@@ -279,6 +279,10 @@ class emailMarketing(multi.Thread):
else:
self.verifyHost = SMTPHosts.objects.get(host=self.extraArgs['host'])
self.smtpServer = smtplib.SMTP(str(self.verifyHost.host), int(self.verifyHost.port))
if int(self.verifyHost.port) == 587:
self.smtpServer.starttls()
self.smtpServer.login(str(self.verifyHost.userName), str(self.verifyHost.password))
return 1
except smtplib.SMTPHeloError: