Exemple #1
0
 /// <summary>
 ///     Send an asynchronous email to the given email addresses as carbon copy.
 /// </summary>
 /// <param name="exception">Your thrown exception to log in your developers email address.</param>
 /// <param name="mailServer">You can pass your custom mailing server to send the mail from.</param>
 /// <param name="methodName">
 ///     Name or the method : System.Reflection.MethodBase.GetCurrentMethod().Name or custom name or
 ///     nameOf(methodName) C# 6.0
 /// </param>
 /// <param name="subject">Mailing subject, your app name will be included automatically.</param>
 /// <param name="entity">Your entity information.</param>
 public void ByEmail(Exception exception, MailServer mailServer, string methodName, string subject = "", object entity = null)
 {
     if (methodName == "")
     {
         methodName = MethodBase.GetCurrentMethod().Name;
     }
     new Thread(() => {
         if (Config.DeveloperEmails != null && Config.IsNotifyDeveloper)
         {
             var body = "";
             GenerateErrorBody(exception, ref subject, ref body, methodName, entity);
             body += Config.GetApplicationNameHtml();
             if (mailServer != null)
             {
                 mailServer.QuickSend(Config.DeveloperEmails, subject, body, null, MailingType.RegularMail, null, false);
             }
         }
     }).Start();
 }