My application uses C# code to send Emails
On win 8.1 it failed to send to Hotmail address using Hotmail SMTP server (smtp.live.com)
same code works with other providers(such as Gmail)
same code runs on win 7 and win 8 works also for Hotmail provider
here is part of my code (with Hotmail parameters)
varsmtpClient =newSmtpClient();
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = newNetworkCredential("my@hotmail.com","myPassword");
smtpClient.Host = "smtp.live.com";
smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.SendCompleted += SmtpClientSendCompleted;
varmailMessage =newMailMessage("my@hotmail.com", "my@gmail.com", "my subject", "my body text");
try
{
smtpClient.Send(mailMessage);
}
catch(Exception ex)
{
MessageBox.Show(string.Format("error send mail: {0}", ex.ToString()));
}
it causes the exception:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host .....
We tried different ports and different methods and different C# code and all failed to send to the smtp.live.com on win 8.1
Meir.