Merge pull request #3270 from vsc55/patch-1

Update GenericEmailProvider.cs
This commit is contained in:
Jamie 2019-11-20 21:36:56 +00:00 committed by GitHub
commit 62994f38d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,14 @@ namespace Ombi.Notifications
client.Authenticate(settings.Username, settings.Password);
}
_log.LogDebug("sending message to {0} \r\n from: {1}\r\n Are we authenticated: {2}", message.To, message.From, client.IsAuthenticated);
await client.SendAsync(message);
try
{
await client.SendAsync(message);
}
catch (MailKit.Net.Smtp.SmtpCommandException e) when (e.ErrorCode.Equals(MailKit.Net.Smtp.SmtpErrorCode.RecipientNotAccepted) && e.StatusCode.Equals(MailKit.Net.Smtp.SmtpStatusCode.MailboxUnavailable))
{
_log.LogError("Could not send email '{0}', address <{1}> does not exist.", message.Subject, model.To);
}
await client.DisconnectAsync(true);
}
}
@ -178,4 +185,4 @@ namespace Ombi.Notifications
}
}
}
}
}