From 2ece05cd1e544e3a86e52efd2d60c31b1f5c4e08 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 28 Oct 2016 11:02:36 -0700 Subject: [PATCH] Fixed: Email connection test reporting success incorrectly Fixes #1524 --- .../Notifications/Email/EmailService.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Email/EmailService.cs b/src/NzbDrone.Core/Notifications/Email/EmailService.cs index bd7a387b0..f1469d2e9 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailService.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailService.cs @@ -45,25 +45,17 @@ namespace NzbDrone.Core.Notifications.Email { _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; - - smtp.Send(email); - } + var smtp = new SmtpClient(server, port); + smtp.EnableSsl = ssl; + smtp.Credentials = credentials; - catch (Exception ex) - { - _logger.Error(ex, "There was an error sending an email."); - throw; - } + smtp.Send(email); } public ValidationFailure Test(EmailSettings settings)