minor fix to email marketing tool

This commit is contained in:
usmannasir
2019-03-19 01:04:22 +05:00
parent 84bfa17ec9
commit b37907af85
3 changed files with 737 additions and 754 deletions

View File

@@ -154,8 +154,8 @@ class emailMarketing(multi.Thread):
smtpServer = smtplib.SMTP('127.0.0.1')
else:
verifyHost = SMTPHosts.objects.get(host=self.extraArgs['host'])
smtpServer = smtplib.SMTP(verifyHost.host, int(verifyHost.port))
smtpServer.login(verifyHost.userName, verifyHost.password)
smtpServer = smtplib.SMTP(str(verifyHost.host), int(verifyHost.port))
smtpServer.login(str(verifyHost.userName), str(verifyHost.password))
except smtplib.SMTPHeloError:
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
'The server didnt reply properly to the HELO greeting.')

View File

@@ -395,8 +395,8 @@ class EmailMarketingManager:
defaultHost.save()
try:
verifyLogin = smtplib.SMTP(smtpHost, int(smtpPort))
verifyLogin.login(smtpUserName, smtpPassword)
verifyLogin = smtplib.SMTP(str(smtpHost), int(smtpPort))
verifyLogin.login(str(smtpUserName), str(smtpPassword))
admin = Administrator.objects.get(pk=userID)
@@ -496,8 +496,8 @@ class EmailMarketingManager:
else:
try:
verifyHost = SMTPHosts.objects.get(id=id)
verifyLogin = smtplib.SMTP(verifyHost.host, int(verifyHost.port))
verifyLogin.login(verifyHost.userName, verifyHost.password)
verifyLogin = smtplib.SMTP(str(verifyHost.host), int(verifyHost.port))
verifyLogin.login(str(verifyHost.userName), str(verifyHost.password))
data_ret = {"status": 1, 'message': 'Login successful.'}
json_data = json.dumps(data_ret)

File diff suppressed because it is too large Load Diff