hi Dear all im getting issue
InnerException = Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
MailMessage mail = new MailMessage("[email protected]", "[email protected]");
SmtpClient client = new SmtpClient("mail.electronichealthcaresystem.net", 25);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;
client.Credentials = new System.Net.NetworkCredential("[email protected]", "123");
mail.Subject = "Testing";
mail.Body = "testing";
try
{
client.Send(mail);
}
catch (Exception ex)
{
Console.WriteLine("Exception caught in CreateTestMessage2(): {0}",
ex.ToString());
}