I am trying to send an SMTP email when certain values in database crosses its threshold value.
I have already allowed ports 25,587 and 465 in the Windows firewall an
Windows Firewall was creating this error for me. SMTP was trying to post to GMAIL at port 587. Adding port 587 to the Outbound rule [Outbound HTTP/SMTP/RDP] resolved the issue.