private bool getEmailDistributionListSendAttachment(bool isSuccessful, string fileName, string threadName, string desFilePath) { bool success = true; IAPL.Transport.Transactions.ServerDetails emailDetails = new ServerDetails(); IAPL.Transport.Data.DbTransaction db = new IAPL.Transport.Data.DbTransaction(); db.emailDistributionList(false, messageInformation.MessageCode, messageInformation.ERP, 0); System.Data.DataTable dTable = db.CommonDataTable; string emailSMTP = IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationsmtp", ""); if (dTable != null) { foreach (System.Data.DataRow row in dTable.Rows) { //IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationsender", "") IAPL.Transport.Operation.Email email = new IAPL.Transport.Operation.Email( IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrFROM"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrTO"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrCC"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrBCC"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldEmailSubject"]), 2, emailSMTP); string mesgBody = this.readNoticationMessageBody(fileName, isSuccessful, IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldXSLTPath"])); ArrayList list = new ArrayList(); fileName = this.serverInformation.GetNetworkSourceFile(desFilePath, fileName); list.Add(fileName); // temporarily set to save as TEXT for the sake of testing.... //success = email.Send(true, mesgBody, list); success = email.Send(false, mesgBody, list); if (!success) { this.ErrorMessage = email.ErrorMessage; } //emailDetails.EmailSubject = row["emldEmailSubject"].ToString(); } } else { success = false; } //return emailDetails; return(success); }
// private bool getEmailDistributionListSendAttachment(bool isSuccessful, string fileName, string threadName, string desFilePath) private bool getIMSEmailDistributionList(int Report, string fileName, string desFilePath, string ThreadName, System.Collections.Hashtable DetailsForIMS, IAPL.Transport.Transactions.MessageDetails mDetails) { bool success = true; IAPL.Transport.Transactions.ServerDetails emailDetails = new ServerDetails(); IAPL.Transport.Data.DbTransaction db = new IAPL.Transport.Data.DbTransaction(); db.emailDistributionList(true, mDetails.MessageCode, mDetails.ERP, Report); System.Data.DataTable dTable = db.CommonDataTable; string emailSMTP = IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationsmtp", ""); if (dTable != null) { foreach (System.Data.DataRow row in dTable.Rows) { IAPL.Transport.Operation.Email email = new IAPL.Transport.Operation.Email( IAPL.Transport.Util.CommonTools.ValueToString((Object)row["IMSemldIntEmailAddrFROM"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["IMSemldIntEmailAddrTO"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["IMSemldIntEmailAddrCC"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["IMSemldIntEmailAddrBCC"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["IMSemldEmailSubject"]), 2, emailSMTP); string mesgBody = this.IMSreadNoticationMessageBody(Report, success, IAPL.Transport.Util.CommonTools.ValueToString((Object)row["IMSemldXSLTPath"]), DetailsForIMS, mDetails.IMSBatchRun); // Email this! //success = email.Send(true, mesgBody, list); success = email.Send(false, mesgBody, null); if (!success) { this.ErrorMessage = email.ErrorMessage; } } } else { success = false; } //return emailDetails; return(success); }
private bool getEmailDistributionListEmailNotification(bool isSuccessful, string fileName, string threadName) { bool success = true; IAPL.Transport.Transactions.ServerDetails emailDetails = new ServerDetails(); IAPL.Transport.Data.DbTransaction db = new IAPL.Transport.Data.DbTransaction(); if (!isSuccessful) { db.emailDistributionList(false, IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationmessagecode", "TECHNICAL_NOTIFICATION"), IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationerp", "IAPL"), 0); } else { db.emailDistributionList(false, messageInformation.MessageCode, messageInformation.ERP, 0); } System.Data.DataTable dTable = db.CommonDataTable; string emailSMTP = IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationsmtp", ""); if (dTable != null) { foreach (System.Data.DataRow row in dTable.Rows) { //IAPL.Transport.Configuration.Config.GetAppSettingsValue("emailnotificationsender", "") IAPL.Transport.Operation.Email email = new IAPL.Transport.Operation.Email( IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrFROM"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrTO"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrCC"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldIntEmailAddrBCC"]), IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldEmailSubject"]), 2, emailSMTP); string mesgBody = this.readNoticationMessageBody(fileName, isSuccessful, IAPL.Transport.Util.CommonTools.ValueToString((Object)row["emldXSLTPath"])); ArrayList list = new ArrayList(); //fileName = this.serverInformation.GetNetworkSourceFile(desFilePath, fileName); //list.Add(fileName); IAPL.Transport.Util.TextLogger.LogSetting("EmailContent [Subject: " + email.Subject + "]", mesgBody); //IAPL.Transport.Util.TextLogger.Log("-->EmailContent [Subject: " + email.Subject + "]", mesgBody); success = email.Send(true, mesgBody, list); if (!success) { this.ErrorMessage = email.ErrorMessage + " (" + email.SmtpServer + ")"; } //emailDetails.EmailSubject = row["emldEmailSubject"].ToString(); } } else { success = false; } //return emailDetails; return(success); }