コード例 #1
0
        //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;
            }
        }
コード例 #2
0
ファイル: Property.cs プロジェクト: khateeb101/ASPHTML5
 public DataTable GetByLatestTable()
 {
     return(Data.GetByLatest(Convert.ToInt32(MiscActivity.GetSettings("DaysCount"))));
 }
コード例 #3
0
ファイル: Property.cs プロジェクト: khateeb101/ASPHTML5
 public PropertyCollection GetByLatest()
 {
     return(InitializeCollection(Data.GetByLatest(Convert.ToInt32(MiscActivity.GetSettings("DaysCount")))));
 }