jaheena wrote:
How can I check firewall and how can I make sure that the firewall is not blocked the port for sending mail
Disable the firewall and re-run your program and check if mails are going through it or not. If they do then it is the firewall issue.
It can be windows firewall or your antivirus firewall.
About port, if you are using your own exchange server then you need to make sure(by yourself or IT team) that the ports are open and allowed to send email with a given credentials.