Removed logs. Enabled ssl

This commit is contained in:
Marcel Baumgartner
2023-03-12 22:05:18 +01:00
parent 65e6823550
commit d5f4278b30

View File

@@ -55,11 +55,9 @@ public class MailService
client.Host = Server; client.Host = Server;
client.Port = Port; client.Port = Port;
client.EnableSsl = false; client.EnableSsl = true;
client.Credentials = new NetworkCredential(Email, Password); client.Credentials = new NetworkCredential(Email, Password);
Logger.Debug("Sending");
await client.SendMailAsync(new MailMessage() await client.SendMailAsync(new MailMessage()
{ {
From = new MailAddress(Email), From = new MailAddress(Email),
@@ -69,16 +67,12 @@ public class MailService
Subject = $"Hey {user.FirstName}, there are news from moonlight", Subject = $"Hey {user.FirstName}, there are news from moonlight",
To = { new MailAddress(user.Email) } To = { new MailAddress(user.Email) }
}); });
Logger.Debug("Send!");
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Warn("Error sending mail"); Logger.Warn("Error sending mail");
Logger.Warn(e); Logger.Warn(e);
} }
Logger.Debug("Mail send task stopped");
}); });
} }