MailMessage msg = new MailMessage("[email protected]", "[email protected]", "Movies this month", "Hello this is a test mail");
msg.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.UseDefaultCredentials = false;
NetworkCredential xre = new System.Net.NetworkCredential("[email protected]", "Password");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = xre;
smtp.EnableSsl = true;
smtp.Send(msg);
This is the code i run in a form . load to do a test email but it will not rund and says operation timed out. ive tried everything please help
MessageBox.Show("mail sent");