From 80d2a7f8e1ad26d498d50db990a4d760129827d5 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 25 May 2016 09:26:53 +0100 Subject: [PATCH] Fixed a small bug where an exception would get thrown --- .../Notification/EmailMessageNotification.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/PlexRequests.Services/Notification/EmailMessageNotification.cs b/PlexRequests.Services/Notification/EmailMessageNotification.cs index efd4abe08..f2217dc7e 100644 --- a/PlexRequests.Services/Notification/EmailMessageNotification.cs +++ b/PlexRequests.Services/Notification/EmailMessageNotification.cs @@ -84,11 +84,8 @@ public async Task NotifyAsync(NotificationModel model, Settings settings) case NotificationType.Test: await EmailTest(model, emailSettings); break; - - default: - throw new ArgumentOutOfRangeException(); } - + } private EmailNotificationSettings GetConfiguration() @@ -168,7 +165,7 @@ private async Task Send(MimeMessage message, EmailNotificationSettings settings) // Note: since we don't have an OAuth2 token, disable // the XOAUTH2 authentication mechanism. client.AuthenticationMechanisms.Remove("XOAUTH2"); - + client.Authenticate(settings.EmailUsername, settings.EmailPassword); await client.SendAsync(message); @@ -185,7 +182,7 @@ private async Task EmailTest(NotificationModel model, EmailNotificationSettings { var message = new MimeMessage { - Body = new TextPart("plain") {Text= "This is just a test! Success!"}, + Body = new TextPart("plain") { Text = "This is just a test! Success!" }, Subject = "Plex Requests: Test Message!", }; message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));