cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Send Email

Hey,

 

I have the below error once I'm sending an email fro the ode in the Plesk hosting 

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 52.96.69.2:587

Please we need a solution!

 

Best regards,

 

1 REPLY 1
Highlighted

Re: Send Email

my code is 

SmtpClient client = new SmtpClient {

   Host = "smtp.office365.com",

   Credentials = new NetworkCredential("<FULL USERNAME@DOMAIN.COM", ConfigurationManager.AppSettings["password"]),

   Port = 587,

   EnableSsl = true,

   Timeout = 10000

};