public void Send(EmailTemplate template, IEmailFormatter formatter, ParameterCollection parameterHash)
 {
     try
     {
         EmailTemplate template2 = formatter.Format(template, parameterHash);
         MailMessage message = this.CreateMailMessage(template2);
         this.smtpClient.Send(message);
     }
     catch (Exception exception)
     {
         //Logger.Error("Error on sending mail: " + exception, new object[0]);
     }
 }
 protected MailMessage CreateMailMessage(EmailTemplate template)
 {
     MailMessage message = new MailMessage(template.From, template.To, template.Subject, template.Body);
     if (!string.IsNullOrEmpty(template.Cc))
     {
         message.CC.Add(template.Cc);
     }
     if (!string.IsNullOrEmpty(template.Bcc))
     {
         message.Bcc.Add(template.Bcc);
     }
     message.IsBodyHtml = !string.IsNullOrEmpty(template.BodyContentType) && template.BodyContentType.Equals("text/html");
     if ((template.LinkedResources != null) && (template.LinkedResources.Count > 0))
     {
         AlternateView item = AlternateView.CreateAlternateViewFromString(template.Body, template.BodyEncoding, "text/html");
         foreach (LinkedResource resource in template.LinkedResources)
         {
             item.LinkedResources.Add(resource);
         }
         message.AlternateViews.Add(item);
     }
     return message;
 }