private static void TrySendMessage(MailMessage message) { try { GenerateSmtpClient().Send(message); } catch (Exception ex) { if (ex is SmtpException) { SueetieLogs.LogSiteEntry(SiteLogType.Exception, SiteLogCategoryType.EmailException, "SMTP ERROR: " + ex.Message); } else { SueetieLogs.LogSiteEntry(SiteLogType.Exception, SiteLogCategoryType.EmailException, "EMAIL ERROR: " + ex.Message); } } }
public static string GetString(string name, string fileName, string[] textArgs) { List <SueetieResource> locals = null; var sueetieContext = SueetieContext.Current; var _language = sueetieContext.SiteSettings.DefaultLanguage ?? "en-US"; if (!string.IsNullOrEmpty(fileName)) { locals = LoadLanguageFile(_language, fileName); } else { locals = LoadLanguageFile(_language, "Sueetie.xml"); } string text = null; try { text = locals.Find(l => l.Key == name).Value; if (textArgs != null) { text = string.Format(text, textArgs); } } catch (Exception ex) { SueetieLogs.LogSiteEntry(SiteLogType.Exception, SiteLogCategoryType.GeneralException, ex.Message + " STRING NAME: " + name + " FILENAME: " + fileName + " STACKTRACE: " + ex.StackTrace); } if (text == null) { #if DEBUG text = string.Format("<strong><FONT color=#ff0000>[{0}]</FONT></strong>", name); SueetieLogs.LogSiteEntry(SiteLogType.Exception, SiteLogCategoryType.GeneralException, string.Format("Missing Resource: {0} Page: {1}", name, sueetieContext.RawUrl)); #else text = string.Empty; #endif } return(text); }