Here is my code:
MailAddress to = new MailAddress("MAIL@hotmail.com");
MailAddress from = new MailAddress("MAIL@hotmail.com");
MailMessage message = new MailMessage(from, to);
message.Subject = "Message du siute as-quebec.net de: " + EmailToSend.Email;
message.Body = EmailToSend.Message;
SmtpClient client = new SmtpClient("smtp.live.com");
client.Credentials = new System.Net.NetworkCredential("MAIL@hotmail.com", "PASSWORD");
client.Send(message);
I have this error:
System.Net.Mail.SmtpException : 'Failure sending mail.'
ExtendedSocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or an established connection failed because the connected host has failed to respond.
Some ideas what I'm doing wrong?