none
SmtpClient send method is not working on Windows Server 2012 (smtp.office365.com) RRS feed

  • Question

  • My asp.net application is sending mails correctly on my development system (windows 7 64bit) deployed on IIS. However the same application deployed on Windows Server 2012 64 bit does not send mails. 

    The following error message is shown

    • System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 191.234.140.34:587 at system.net.ServicePoint.ConnectSocketInternal.........

    What could be wrong?

    Could you please help me to fix this problem


    thanks and regards

    venkatesh g

    Wednesday, October 15, 2014 3:05 PM

All replies

  • Make sure Host, Port and EnableSSL and Credentials property of SmtpClient are correct.

    Gaurav Khanna | Microsoft VB.NET MVP | Microsoft Community Contributor

    Wednesday, October 15, 2014 4:29 PM
  • Thank you for your reply. All parameters are correct and with the same parameters it is working fine on windows 7 IIS. 

    And to add more to the question, few times I get The operation has timed out exception.


    Thursday, October 16, 2014 1:24 AM
  • Hello venkateshGopalaiah,

    Do you try to make a small test as using the smtpclient with gmail described in this blog to see if this would work with Windows Server 2012? This would help narrow this issue to find this isssue is caused by the Sever or the smtp.office365.com.

    Friday, October 17, 2014 7:21 AM