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 CreateFile(string StrProcedure, string FileName, string Subject, string ToAddress, string CCAddress, string BCCAddress, string Body, string FilterParameter)
        {
            try
            {
                string GenFileName = ReportFiles.CreateFiles(StrProcedure, FileName, FilterParameter);

                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;
            }
        }