Пример #1
0
 private void Send(string message)
 {
     var task = Task.Factory.StartNew(status =>
     {
         MailHelper mail = new MailHelper();
         mail.SendMailToAdminWithError(Caption, message);
     }, "SendMail").ContinueWith((t) =>
     {
         if (t.Exception != null) log.LogMessage(t.Exception);
     });
     task.Wait();
 }
Пример #2
0
 //-------------------------------------------------------------------------
 private void SendMailAsync(string message, string email, List<string> attachments, string caption = "")
 {
     System.Threading.Tasks.Task.Factory.StartNew(status =>
     {
         MailHelper mail = new MailHelper();
         mail.Attachments = attachments;
         if (caption == "")
         {
             if (sendToSupport)
             {
                 mail.SendMailToSupport(message, email);
             }
             else
             {
                 mail.SendMailToSupport(message, email, "Report test page");
             }
         }
         else
         {
             mail.SendMailToSupport(message, email, caption);
         }
     }, attachments.First()).ContinueWith((t) => Completed(t));
 }
Пример #3
0
 //-------------------------------------------------------------------------
 private void SendMail(string caption = null)
 {
     Task.Factory.StartNew(status =>
     {
         MailHelper mail = new MailHelper();
         mail.SendMail(caption);
     }, "SendMail").ContinueWith((t) => Completed(t));
 }