diff --git a/src/NzbDrone.Common/Radarr.Common.csproj b/src/NzbDrone.Common/Radarr.Common.csproj
index e530bcb543..9928c9e3ff 100644
--- a/src/NzbDrone.Common/Radarr.Common.csproj
+++ b/src/NzbDrone.Common/Radarr.Common.csproj
@@ -4,7 +4,7 @@
ISMUSL
-
+
diff --git a/src/NzbDrone.Core/MediaCover/ImageResizer.cs b/src/NzbDrone.Core/MediaCover/ImageResizer.cs
index ec2eefa786..c2f85c209b 100644
--- a/src/NzbDrone.Core/MediaCover/ImageResizer.cs
+++ b/src/NzbDrone.Core/MediaCover/ImageResizer.cs
@@ -42,11 +42,9 @@ namespace NzbDrone.Core.MediaCover
try
{
- using (var image = Image.Load(source))
- {
- image.Mutate(x => x.Resize(0, height));
- image.Save(destination);
- }
+ using var image = Image.Load(source);
+ image.Mutate(x => x.Resize(0, height));
+ image.Save(destination);
}
catch
{
diff --git a/src/NzbDrone.Core/Notifications/Email/Email.cs b/src/NzbDrone.Core/Notifications/Email/Email.cs
index 7ab45ce1bc..a92b9c67a7 100644
--- a/src/NzbDrone.Core/Notifications/Email/Email.cs
+++ b/src/NzbDrone.Core/Notifications/Email/Email.cs
@@ -83,23 +83,6 @@ namespace NzbDrone.Core.Notifications.Email
return new ValidationResult(failures);
}
- public ValidationFailure Test(EmailSettings settings)
- {
- const string body = "Success! You have properly configured your email notification settings";
-
- try
- {
- SendEmail(settings, "Radarr - Test Notification", body);
- }
- catch (Exception ex)
- {
- _logger.Error(ex, "Unable to send test email");
- return new ValidationFailure("Server", "Unable to send test email");
- }
-
- return null;
- }
-
private void SendEmail(EmailSettings settings, string subject, string body, bool htmlBody = false)
{
var email = new MimeMessage();
@@ -129,52 +112,67 @@ namespace NzbDrone.Core.Notifications.Email
throw;
}
- _logger.Debug("Finished sending email. Subject: {0}", email.Subject);
+ _logger.Debug("Finished sending email. Subject: {0}", subject);
}
private void Send(MimeMessage email, EmailSettings settings)
{
- using (var client = new SmtpClient())
+ using var client = new SmtpClient();
+ client.Timeout = 10000;
+
+ var serverOption = SecureSocketOptions.Auto;
+
+ if (settings.RequireEncryption)
{
- client.Timeout = 10000;
-
- var serverOption = SecureSocketOptions.Auto;
-
- if (settings.RequireEncryption)
+ if (settings.Port == 465)
{
- if (settings.Port == 465)
- {
- serverOption = SecureSocketOptions.SslOnConnect;
- }
- else
- {
- serverOption = SecureSocketOptions.StartTls;
- }
+ serverOption = SecureSocketOptions.SslOnConnect;
}
-
- client.ServerCertificateValidationCallback = _certificateValidationService.ShouldByPassValidationError;
-
- _logger.Debug("Connecting to mail server");
-
- client.Connect(settings.Server, settings.Port, serverOption);
-
- if (!string.IsNullOrWhiteSpace(settings.Username))
+ else
{
- _logger.Debug("Authenticating to mail server");
-
- client.Authenticate(settings.Username, settings.Password);
+ serverOption = SecureSocketOptions.StartTls;
}
-
- _logger.Debug("Sending to mail server");
-
- client.Send(email);
-
- _logger.Debug("Sent to mail server, disconnecting");
-
- client.Disconnect(true);
-
- _logger.Debug("Disconnecting from mail server");
}
+
+ client.ServerCertificateValidationCallback = _certificateValidationService.ShouldByPassValidationError;
+
+ _logger.Debug("Connecting to mail server");
+
+ client.Connect(settings.Server, settings.Port, serverOption);
+
+ if (!string.IsNullOrWhiteSpace(settings.Username))
+ {
+ _logger.Debug("Authenticating to mail server");
+
+ client.Authenticate(settings.Username, settings.Password);
+ }
+
+ _logger.Debug("Sending to mail server");
+
+ client.Send(email);
+
+ _logger.Debug("Sent to mail server, disconnecting");
+
+ client.Disconnect(true);
+
+ _logger.Debug("Disconnecting from mail server");
+ }
+
+ public ValidationFailure Test(EmailSettings settings)
+ {
+ const string body = "Success! You have properly configured your email notification settings";
+
+ try
+ {
+ SendEmail(settings, "Radarr - Test Notification", body);
+ }
+ catch (Exception ex)
+ {
+ _logger.Error(ex, "Unable to send test email");
+ return new ValidationFailure("Server", "Unable to send test email");
+ }
+
+ return null;
}
private MailboxAddress ParseAddress(string type, string address)
diff --git a/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs b/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs
index ae495f42e0..0c79c351a9 100644
--- a/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs
+++ b/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs
@@ -32,7 +32,8 @@ namespace NzbDrone.Core.Notifications.Email
public EmailSettings()
{
- Port = 567;
+ Port = 587;
+
To = Array.Empty();
Cc = Array.Empty();
Bcc = Array.Empty();
diff --git a/src/NzbDrone.Core/Radarr.Core.csproj b/src/NzbDrone.Core/Radarr.Core.csproj
index b44e73a516..992ba179a1 100644
--- a/src/NzbDrone.Core/Radarr.Core.csproj
+++ b/src/NzbDrone.Core/Radarr.Core.csproj
@@ -5,7 +5,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
diff --git a/src/NzbDrone.Host/Radarr.Host.csproj b/src/NzbDrone.Host/Radarr.Host.csproj
index 092650f8c5..56c59881b4 100644
--- a/src/NzbDrone.Host/Radarr.Host.csproj
+++ b/src/NzbDrone.Host/Radarr.Host.csproj
@@ -7,8 +7,8 @@
-
-
+
+
diff --git a/src/NzbDrone.Update/Radarr.Update.csproj b/src/NzbDrone.Update/Radarr.Update.csproj
index da0e1a3935..0359841165 100644
--- a/src/NzbDrone.Update/Radarr.Update.csproj
+++ b/src/NzbDrone.Update/Radarr.Update.csproj
@@ -4,8 +4,8 @@
net6.0
-
-
+
+