DominusDRR
Member
- Joined
- Nov 19, 2021
- Messages
- 10
- Programming Experience
- 5-10
Hi.
I have the following code that works perfectly with C# and WPF:
I'm implementing the same thing with android and C#, but when the program reaches SmtpServer.Send it freezes on that line. No exception or some kind of error occurs.
I have also tried putting this code in an asynchronous task, but the result is the same.
Any comments or suggestions are welcome.
Could I share with you the link to a very simple example code so that you can check the problem that happens to me?
I have the following code that works perfectly with C# and WPF:
Sending an email with SmtpClient:
String emaailO = "xxxxxxx@outlook.com";
String passwordO = "123456789";
SmtpClient SmtpServer = new SmtpClient("smtp.live.com");
var mail = new MailMessage();
mail.From = new MailAddress(emaailO);
mail.To.Add(etEmailUser.Text);
mail.Subject = "Subject";
mail.IsBodyHtml = true;
mail.Body = "email body";
SmtpServer.Port = 587;
SmtpServer.UseDefaultCredentials = false;
SmtpServer.Credentials = new System.Net.NetworkCredential(emaailO, passwordO);
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
I'm implementing the same thing with android and C#, but when the program reaches SmtpServer.Send it freezes on that line. No exception or some kind of error occurs.
I have also tried putting this code in an asynchronous task, but the result is the same.
Any comments or suggestions are welcome.
Could I share with you the link to a very simple example code so that you can check the problem that happens to me?