با نوشتن کد زیر برای ارسال ایمیل MailMessage msg = new MailMessage();
msg.From = new MailAddress("ali@MyCompany.com");
msg.To.Add("ali@MyCompany.com");
msg.Subject = "for test";
msg.Body = "this is for test";
SmtpClient smtp = new SmtpClient("mail.MyCompany.com", 25);
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("ali@MyCompany.com", "MyPassword");
try
{
smtp.Send(msg);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
با خطای زیر روبر می شوم لطفا راهنمایی کنید "An established connection was aborted by the software in your host machine"