Skip to content

Commit

Permalink
Fixed a small bug where an exception would get thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed May 25, 2016
1 parent 0cf73f2 commit 80d2a7f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand All @@ -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));
Expand Down

0 comments on commit 80d2a7f

Please sign in to comment.