Hi all a couple weeks ago, my ASP.NET website stopped sending user comments which I implemented by emailing those comments to my email account through Gmail SMTP server (smtp.gmail.com). I opened the project on my development machine and again it fails to send the email after a couple minutes with the following exception message:
Failure sending mail
Unable to read data from the transport connection: net_io_connectionclosed.
I'm using Gmail's SMTP with port 465, and MailClient.EnableSSL = True. The weird thing is my Office Outlook 2007 is using the same settings and it doesn't have any problems sending mail using the same Gmail account.
Any thoughts?
One oddity I found with formmail going through gmail (on Windows server) was that the port number was the problem. My code was similar to yours, but it only worked when I changed the port to 25 rather than the 587 or 465. That might be what you need here.
This code works for me. Note the port number is different to the 465 you are trying. I'm almost certain I also tried 465 first with no luck.
You wouldn't happen to have a firewall disallowing outbound connections here then, say, specifically allowed outlook to punch through . . .