Email is not being sent while using own SMTP

Sometime you might see an issue while using own SMTP email is not getting delivered for some user, and if we look into harness manager logs we see that email was triggered successfully.
So first thing we need to verify by checking the SMTP logs to see if there is some restriction/rule that is causing this behaviour and we can also check and confirm if the email reached to smtp server or not by filtering on user email, But in some case we might not have access to smtp logs instantly and can add delay in process.
So we can use below sample python script from delegate to test if the email is getting delivered or not to isolate the issue.
So please save below script with extension .py and update below:
host = “your smtp host”
port =
FROM = <“your email”>
TO =

import smtplib

host = ""
port = 465


server = smtplib.SMTP(host, port)

FROM = ""
TO = ""
MSG = "Subject: Test email python\n\nBody of your message!"


server.sendmail(FROM, TO, MSG)


print ("Email Sent")
1 Like