I wrote the first program in my life in c # wpf with sending mail to outlook. Mail leaves my computer normally, and any other computer gets an error and the program crashes:
The name of the failed application: NUP.exe, version: 1.0.0.0, time stamp: 0x5b51a634
The name of the failed module: KERNELBASE.dll, version: 10.0.14393.0, time stamp: 0x57898e34
Exception code: 0xe0434352
Error offset: 0x000d96c2
Failure Process ID: 0x2b58
Runtime of failed application: 0x01d4224db09239a5
The path of the failed application: \ 172.23.100.14 \ nup \ NUP.exe
Path of the failed module: C: \ Windows \ System32 \ KERNELBASE.dll
Report ID: f33e32fa-a659-4788-afaa-59192a17143e
The full name of the failed package: The application code associated with the failed package:
The second error:
Application: NUP.exe Platform Version: v4.0.30319 Description. The process was terminated due to an unhandled exception. Exception Details: System.Net.Mail.SmtpException
Please help me understand
Code
SmtpClient smtp = new SmtpClient("smtp.myoutlook.ru", 587); using (MailMessage message = new MailMessage()) { string FromAddr = "from"; string ToAddr = "to"; bool EnableSSL = false; string Login = "login"; string Password = "pass"; Encoding encoding = System.Text.Encoding.GetEncoding("windows-1251"); message.IsBodyHtml = false; message.SubjectEncoding = encoding; message.BodyEncoding = encoding; MessageBox.Show("From address: " + FromAddr); message.From = new MailAddress(FromAddr, encoding); message.Bcc.Add(new MailAddress(ToAddr, encoding)); message.Subject = "Subject"; message.Body = "Body"; smtp.UseDefaultCredentials = false; smtp.EnableSsl = EnableSSL; MessageBox.Show("Enable SSL is: " + EnableSSL.ToString()); if (!String.IsNullOrEmpty(Login) && !String.IsNullOrEmpty(Password)) { MessageBox.Show("Login is " + Login); smtp.Credentials = new System.Net.NetworkCredential(Login, Password); } smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Send(message);