static void Main(string[] args) { SEC_OTN otn = new SEC_OTN(); otn.DBConnect(); var file = otn.getOnTimeData().ToFileWrite(path); //ToFileWrite() path parameter input otn.DBdisconnet(); #region FTP UPLoad ExportFile previousFile = ExportFile.GetFile("PCBINFOR_A0ND" + DateTime.Now.ToString("yyyyMMddHH"), "ff", previousPath); FtpServer ftp = new FtpServer() { Host = "stftp.simmtech.com", UserName = "******", Password = "******", Path = "/ymsoy" }; ftp.ProgressChanged += Ftp_ProgressChanged; ftp.Upload(previousFile); //FtpServer ftp = new FtpServer() { Host = "stftp.simmtech.com", UserName = "******", Password = "******", Path = "/ymsoy" }; //ftp.ProgressChanged += Ftp_ProgressChanged; //ftp.Upload(file); #endregion #region e-Mail Send SmtpServer smtp = new SmtpServer() { Host = "systemmail.simmtech.com", Port = 25, UserName = "******", Password = "" }; smtp.Attatchments.Add(file.FullName); smtp.Attatchments.Add(logfile.FullName); smtp.From = smtp.UserName; smtp.To.Add("*****@*****.**"); //권정수 팀장 smtp.To.Add("*****@*****.**"); //박진희 차장 smtp.To.Add("*****@*****.**"); //이규호 주임 smtp.To.Add("*****@*****.**"); //김화영 주임 smtp.CC.Add("*****@*****.**"); smtp.CC.Add("jipark @simmtech.com"); smtp.CC.Add("*****@*****.**"); smtp.CC.Add("*****@*****.**"); //smtp.To.Add("*****@*****.**"); smtp.Subject = "[SEC OTN] - " + file.Name + " 첨부 건."; smtp.Body.Append("ATTACH SEC OTN DATA FILE AND LOG FILE."); smtp.Send(); #endregion }