|
|
@ -45,12 +45,11 @@ namespace NzbDrone.Core.Notifications.Email
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Error("Error sending email. Subject: {0}", email.Subject);
|
|
|
|
_logger.Error("Error sending email. Subject: {0}", email.Subject);
|
|
|
|
_logger.Debug(ex, ex.Message);
|
|
|
|
_logger.Debug(ex, ex.Message);
|
|
|
|
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Send(MailMessage email, string server, int port, bool ssl, NetworkCredential credentials)
|
|
|
|
private void Send(MailMessage email, string server, int port, bool ssl, NetworkCredential credentials)
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var smtp = new SmtpClient(server, port);
|
|
|
|
var smtp = new SmtpClient(server, port);
|
|
|
|
smtp.EnableSsl = ssl;
|
|
|
|
smtp.EnableSsl = ssl;
|
|
|
@ -59,13 +58,6 @@ namespace NzbDrone.Core.Notifications.Email
|
|
|
|
smtp.Send(email);
|
|
|
|
smtp.Send(email);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Error(ex, "There was an error sending an email.");
|
|
|
|
|
|
|
|
throw;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ValidationFailure Test(EmailSettings settings)
|
|
|
|
public ValidationFailure Test(EmailSettings settings)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const string body = "Success! You have properly configured your email notification settings";
|
|
|
|
const string body = "Success! You have properly configured your email notification settings";
|
|
|
|