예제 #1
0
        public static void DataCheckupEMail()
        {
            try
            {
                using (StreamWriter writer =
                           new StreamWriter(@"c:\temp\Cachecallback.txt", true))
                {
                    writer.WriteLine("Daily Data Checkup Email Event", DateTime.Now);
                    writer.Close();
                }
            }
            catch (Exception x)
            {
                Debug.WriteLine(x);
            }



            EmailMessage message = new EmailMessage();

            message.Subject = "Daily Data Checkup Reports";


            string ToAddress = "*****@*****.**";
            string CCAddress = "[email protected],[email protected] ";


            string domain = ConfigurationManager.AppSettings["domain"];

            message.To = ToAddress;
            message.CC = CCAddress;



            try
            {
                string FilenameList;

                string GenFileName = ReportFiles.CreateFiles("SpCheck__JobOrderHeaderStatus", "", "");

                using (StreamWriter writer =
                           new StreamWriter(@"c:\temp\Cachecallback.txt", true))
                {
                    writer.WriteLine(GenFileName);
                    writer.Close();
                }



                FilenameList = GenFileName;
                SendEmail.SendEmailMsgWithAttachment(message, FilenameList);
            }

            catch (Exception ex)
            {
                return;
            }
        }
예제 #2
0
        public void CreateFileFromSQLReporting(string ReportName, string FileName, string Subject, string ToAddress, string CCAddress, string BCCAddress, string Body, string FilterParameter, string Parameter, string ParameterValue)
        {
            try
            {
                string GenFileName = ReportFiles.CreateFilesFromSQLReporting(ReportName, FileName, FilterParameter, "System", Parameter, ParameterValue);

                using (StreamWriter writer =
                           new StreamWriter(@"c:\temp\Cachecallback.txt", true))
                {
                    writer.WriteLine(GenFileName);
                    writer.Close();
                }

                EMailLst.Add(new EMailContent()
                {
                    Subject = Subject, ToAddress = ToAddress, CCAddress = CCAddress, BCCAddress = BCCAddress, Body = Body, FileName = GenFileName
                });
            }

            catch (Exception ex)
            {
                return;
            }
        }