1

I'm trying to send mail using smtp which was working fine on previous production server but after when i moved it to another production server mail is not delivering and displaying the inner exception stating

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions [2607:f8b0:400e:c04::6d]:587

EDIT: Here is my web config mail setting snippet

<system.net>
     <defaultProxy />
     <mailSettings>
      <smtp deliveryMethod="Network" from="xx.yyy@gmail.com">
          <network host="smtp.gmail.com" port="587" userName="xx.yyy@gmail.com" password="xyz@123" enableSsl="true"/>
      </smtp>
    </mailSettings>
</system.net>

I've searched it on stack overflow and other platforms but the error code i got didn't match with anyone. I also blocked firewall, changed port number none of it worked. It has already ate too much of my time. Please let me know what has happened and thanks in advance

Ravi
  • 43
  • 1
  • 7
  • Try adding 587 as allowed outbound port in firewall rule (if you have access to server settings) or check user privileges. Which server you're currently using (since in previous server the app works, but current one not)? Can your provide mail sending example to check with? – Tetsuya Yamamoto Oct 06 '17 at 09:50

0 Answers0