private static void SendWaitForLockErrorMail()
{
if (!string.IsNullOrEmpty(RepositoryConfiguration.NotificationSender) && !string.IsNullOrEmpty(RepositoryConfiguration.IndexLockFileRemovedNotificationEmail))
{
try
{
var smtpClient = new System.Net.Mail.SmtpClient();
var msgstr = string.Format(WRITELOCKREMOVEERRORTEMPLATESTR,
RepositoryConfiguration.IndexLockFileWaitForRemovedTimeout,
AppDomain.CurrentDomain.FriendlyName,
AppDomain.CurrentDomain.BaseDirectory);
var msg = new System.Net.Mail.MailMessage(
RepositoryConfiguration.NotificationSender,
RepositoryConfiguration.IndexLockFileRemovedNotificationEmail,
WRITELOCKREMOVEERRORSUBJECTSTR,
msgstr);
smtpClient.Send(msg);
}
catch (Exception ex)
{
Logger.WriteException(ex);
}
}
else
{
Logger.WriteError(string.Format(WRITELOCKREMOVEEMAILERRORSTR,
RepositoryConfiguration.NotificationSenderKey,
RepositoryConfiguration.IndexLockFileRemovedNotificationEmailKey));
}
}