Unverified Commit 9a4386e2 authored by Javier Pastor's avatar Javier Pastor Committed by GitHub

Update GenericEmailProvider.cs

Add the two checks in when inside catch.
parent 102d6ea1
......@@ -100,16 +100,9 @@ namespace Ombi.Notifications
{
await client.SendAsync(message);
}
catch (MailKit.Net.Smtp.SmtpCommandException e) when (e.ErrorCode.Equals(MailKit.Net.Smtp.SmtpErrorCode.RecipientNotAccepted))
catch (MailKit.Net.Smtp.SmtpCommandException e) when (e.ErrorCode.Equals(MailKit.Net.Smtp.SmtpErrorCode.RecipientNotAccepted) && e.StatusCode.Equals(MailKit.Net.Smtp.SmtpStatusCode.MailboxUnavailable))
{
if (e.StatusCode.Equals(MailKit.Net.Smtp.SmtpStatusCode.MailboxUnavailable))
{
_log.LogError("Could not send email '{0}', address <{1}> does not exist.", message.Subject, model.To);
}
else
{
throw;
}
_log.LogError("Could not send email '{0}', address <{1}> does not exist.", message.Subject, model.To);
}
await client.DisconnectAsync(true);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment