When I try to send email on computer with enviroment(Visual Studio 2015) everything is fine but when I copied it to another computer(VMWare Virtual Machine) and try to run it shutdown, here is main code:
try
{
SmtpClient client = new SmtpClient();
client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
client.Timeout = 10000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("bazymysql@gmail.com", "xyz");
MailMessage mm = new MailMessage("donotreply@domain.com", "bazymysql@gmail.com", "Przechwycony ciag znakow", tresc.Text);
mm.BodyEncoding = UTF8Encoding.UTF8;
mm.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
client.Send(mm);
}
catch (SmtpException ex)
{
MessageBox.Show(ex.Message);
}
What I've tried:
- copy System.Net dll
- developing 86x 64x
- run as admin