mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 01:38:24 +00:00
parent
25a3f83ebc
commit
2ece05cd1e
1 changed files with 5 additions and 13 deletions
|
@ -45,25 +45,17 @@ public void SendEmail(EmailSettings settings, string subject, string body, bool
|
|||
{
|
||||
_logger.Error("Error sending email. Subject: {0}", email.Subject);
|
||||
_logger.Debug(ex, ex.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void Send(MailMessage email, string server, int port, bool ssl, NetworkCredential credentials)
|
||||
{
|
||||
try
|
||||
{
|
||||
var smtp = new SmtpClient(server, port);
|
||||
smtp.EnableSsl = ssl;
|
||||
smtp.Credentials = credentials;
|
||||
var smtp = new SmtpClient(server, port);
|
||||
smtp.EnableSsl = ssl;
|
||||
smtp.Credentials = credentials;
|
||||
|
||||
smtp.Send(email);
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "There was an error sending an email.");
|
||||
throw;
|
||||
}
|
||||
smtp.Send(email);
|
||||
}
|
||||
|
||||
public ValidationFailure Test(EmailSettings settings)
|
||||
|
|
Loading…
Reference in a new issue