1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 23:42:33 +01:00

SendEmail will catch any errors thrown in Send, so Notifications don't blow up. It will also log additional details.

This commit is contained in:
Mark McDowall 2012-04-30 09:42:07 -07:00
parent b626dc2435
commit e8122685b2

View File

@ -54,8 +54,15 @@ namespace NzbDrone.Core.Providers
credentials = new NetworkCredential(username, password); credentials = new NetworkCredential(username, password);
//Send the email //Send the email
try
{
Send(email, _configProvider.SmtpServer, _configProvider.SmtpPort, _configProvider.SmtpUseSsl, credentials); Send(email, _configProvider.SmtpServer, _configProvider.SmtpPort, _configProvider.SmtpUseSsl, credentials);
} }
catch(Exception ex)
{
Logger.Error("Error sending email. Subject: {0}", email.Subject);
}
}
public virtual bool SendTestEmail(string server, int port, bool ssl, string username, string password, string fromAddress, string toAddresses) public virtual bool SendTestEmail(string server, int port, bool ssl, string username, string password, string fromAddress, string toAddresses)
{ {