This was a problem I had while trying to send email from my local workstation through a web application. The script would execute fine, but I wouldn’t receive any email. Upon further investigation (which included walking through a debugging session to find out what was going wrong), I came across an exception when trying to use:
The exception that was thrown have the following error message:
After a couple of minutes of realizing that I was not using localhost as my SMTP server, I figured there was either a problem with my mail relay, or something wrong with my workstation. A couple of Google hits returned that the problem was a VirusScanner issue. Sure enough, when I took a look at my Access Protection settings in McAfee VirusScan Enterprise 8.0i, one of the ports that was being blocked from sending traffic was port 25. There were 3 possibilities that I could have taken to resolve this:
- Disable port 25 blocking
- Delete the port 25 block rule
- Add both aspnet_wp.exe and w3wp.exe to the exclusion list.
All three of these solutions worked for about 5 minutes and allowed email to be sent through my application. However, after that 5 minute period, the rules were restored. I’m not entirely certain why they were restored despite my making sure that they were saved and took immediately after closing the VirusScan Console, but I’m in the process of figuring that problem out.