Exemple #1
0
 public static void SendMail(string subject, string message, string to, string from = null)
 {
     stackVariable0 = new MailMessage();
     stackVariable0.set_IsBodyHtml(true);
     stackVariable2 = from;
     if (stackVariable2 == null)
     {
         dummyVar0      = stackVariable2;
         stackVariable2 = MixService.instance.get_Smtp().Value <string>("From");
     }
     stackVariable0.set_From(new MailAddress(stackVariable2));
     V_0 = stackVariable0;
     V_0.get_To().Add(to);
     V_0.set_Body(message);
     V_0.set_Subject(subject);
     try
     {
         stackVariable15 = new SmtpClient(MixService.instance.get_Smtp().Value <string>("Server"));
         stackVariable15.set_UseDefaultCredentials(false);
         stackVariable15.set_Credentials(new NetworkCredential(MixService.instance.get_Smtp().Value <string>("User"), MixService.instance.get_Smtp().Value <string>("Password")));
         stackVariable15.set_Port(MixService.instance.get_Smtp().Value <int>("Port"));
         stackVariable15.set_EnableSsl(MixService.instance.get_Smtp().Value <bool>("SSL"));
         stackVariable15.Send(V_0);
     }
     catch
     {
         dummyVar1 = exception_1;
         try
         {
             stackVariable38 = new SmtpClient();
             stackVariable38.set_UseDefaultCredentials(true);
             stackVariable38.Send(V_0);
         }
         catch (Exception exception_0)
         {
             MixService.LogException(exception_0);
         }
     }
     return;
 }