//public static string GetSettings(string key) //{ // return ConfigurationManager.AppSettings[key]; //} public static void SendEmail(string[] emailTo, string[] emailCc, string subject, string body, string AttachementfileName = "", Stream Attachement = null) { try { MailMessage message = new MailMessage(); PopulateMailAddressCollection(message.To, emailTo); PopulateMailAddressCollection(message.CC, emailCc); message.From = new MailAddress(MiscActivity.GetSettings("EmailFrom").ToString()); message.Subject = subject; message.Body = body; message.IsBodyHtml = true; if (Attachement != null) { message.Attachments.Add(new System.Net.Mail.Attachment(Attachement, AttachementfileName)); } SmtpClient smtp = new SmtpClient(MiscActivity.GetSettings("SmtpClient").ToString()); smtp.Port = Convert.ToInt32(MiscActivity.GetSettings("SmtpPort").ToString()); smtp.Send(message); } catch (Exception ex) { //Common.LogEvent(ex.ToString(), EventLogEntryType.Error); throw ex; } }
public DataTable GetByLatestTable() { return(Data.GetByLatest(Convert.ToInt32(MiscActivity.GetSettings("DaysCount")))); }
public PropertyCollection GetByLatest() { return(InitializeCollection(Data.GetByLatest(Convert.ToInt32(MiscActivity.GetSettings("DaysCount"))))); }