Exemplo n.º 1
0
 private void EmailETLFiles()
 {
     try
     {
         Utilities.EmailSender message = new Utilities.EmailSender(SMTPServerName, EmailTo, EmailFrom, EmailSubject);
         var fileList = System.IO.Directory.EnumerateFiles(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Ripple"), "*.etl", SearchOption.TopDirectoryOnly);
         foreach (var t in fileList)
         {
             try
             {
                 message.addAttachments(t);
                 if (!fileListToBeDeleted.Contains(t))
                 {
                     fileListToBeDeleted.Add(t);
                 }
             }
             catch (Exception ex)
             {
                 MicrosoftIT.ManagedLogging.LogManager.LogTrace(1, "Went wrong in Emailing ETL files {0}", ex.Message);
             }
         }
         message.sendmail(EmailBody);
         message.Dispose();
     }
     catch (Exception ex)
     {
         MicrosoftIT.ManagedLogging.LogManager.LogTrace(1, "Went wrong in sending the ETL files {0}", ex.Message);
     }
 }
Exemplo n.º 2
0
 private void EmailETLFiles()
 {
     try
     {
         Utilities.EmailSender message = new Utilities.EmailSender(SMTPServerName, EmailTo, EmailFrom, EmailSubject);
         var fileList = System.IO.Directory.EnumerateFiles(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Ripple"), "*.etl", SearchOption.TopDirectoryOnly);
         foreach (var t in fileList)
         {
             try
             {
                 message.addAttachments(t);
                 if(!fileListToBeDeleted.Contains(t))
                     fileListToBeDeleted.Add(t);
             }
             catch (Exception ex)
             {
                 MicrosoftIT.ManagedLogging.LogManager.LogTrace(1, "Went wrong in Emailing ETL files {0}", ex.Message);
             }
         }
         message.sendmail(EmailBody);
         message.Dispose();
     }
     catch (Exception ex)
     {
         MicrosoftIT.ManagedLogging.LogManager.LogTrace(1,"Went wrong in sending the ETL files {0}", ex.Message);
     }
 }