I have an application that worked perfectly until this Saturday. Every time I try send an email I receive the error "ExtendedSocketException: Connection refused [::ffff:xxx.xxx.xxx.xxxx]:25". I tried with 465 port but no solve the problem and it's show the error IOException: Unable to read data from the transport connection: The connection was closed.
The account email that I use in this app I use in my smartphone too and yesterday the I lost the connection with server. I contacted my provider and after remove the account and configured its started working again.
In the app I have this code
SmtpClient smtp = new SmtpClient("mail.yyyy.com", 465);
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential("noreply@yyyy.com", "xxxxx");
MailAddress from = new MailAddress("noreply@yyyy.com", "yyyy - NoReply");
MailAddress to = new MailAddress(mail);
MailMessage mailMessage = new MailMessage(from, to);
mailMessage.Subject = subject;
mailMessage.IsBodyHtml = true;
reader = new StreamReader("wwwroot/templates/emails/comment-company.htm");
body = reader.ReadToEnd();
body = body.Replace("{url}", url);
body = body.Replace("{company}", name);
mailMessage.Body = body;
smtp.Send(mailMessage);
Anyone have an idea what I can do to solve this?