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