I have written a simple program in C# that sends mail notifications. It works great on Windows 7, but it fails on Server 2008.
I've read a bit about it, but I can't see what is keeping me from sending mail. I've opened port 587 (SSL port for Gmail) outgoing and ingoing (TCP) but still no luck. I even opened the firewall for the whole program. Are there specific settings in Windows Server that I should be aware of?
*Edit - No other firewalls than windows' own.
Stack trace:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 74.125..:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace ---
EDIT: I found my answer: The problem was nothing to do with windows server. It was because it could not connect to my database. Silly me. Earlier i got a connection error when not able to connect to database, but now all i got was weird error messages; one of which was posted here.
Thanks for all help anyways! Great to get help so quickly.
465
(587
is the TLS port). Maybe that's the problem? – Frédéric Hamidi