title: Add constructor logic here
body: <p>I am trying to finish this piece of code so my smtp web.config code will send an email. I never made this code so I am unsure of what has to go at the top. I'm very new to coding and have never done web development before getting the job I have now. Right after <code>public EmailHelper()</code> in comments it says <code>To Do: Add constructor logic here.</code> I don't understand what the person who wrote it means.</p>
  
  <p>Note: I took out the email and passwords so you could not see them they were not left out by accident.</p>
  
  <pre><code>    using System;
      using System.Collections;
      using System.Collections.Generic;
      using System.Web;
      using System.Net.Mail;
      using IBEW2330_2018.Domain;
  
      namespace IBEW2330_2018.Helpers
      {
          /// &lt;summary&gt;
          /// Summary description for EmailService
          /// &lt;/summary&gt;
          public class EmailHelper
          {
              public EmailHelper()
              {
                  //
                  // TODO: Add constructor logic here
                  //
  
              }
              public static string SendEmailWithCCList(string emailBody, string Subject, string emailTo, List&lt;Member&gt; member) //TODO: Edit/Test
              {
                  string message = "";
                  try
                  {
                      System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
                      mail.To.Add(emailTo);
  
                      if (member != null)
                      {
                          foreach (Member m in member)
                          {
                              if(Validator.EmailIsValid(m.EmailAddress))
                              {
                                  mail.Bcc.Add(m.EmailAddress);
                              }
                          }
                      }
                      mail.From = new MailAddress("", Subject, System.Text.Encoding.UTF8);
                      mail.Subject = Subject;
                      mail.SubjectEncoding = System.Text.Encoding.UTF8;
                      mail.Body = emailBody;
                      mail.BodyEncoding = System.Text.Encoding.UTF8;
                      mail.IsBodyHtml = true;
                      mail.Priority = MailPriority.High;
                      SmtpClient client = new SmtpClient();
                      client.Port = 2525;
                      client.Host = "port80.smtpcorp.com";
                      client.Credentials = new System.Net.NetworkCredential("", "");
                      client.EnableSsl = true;
                      client.Send(mail);
                      message = "alert('Successfully Sent...');";
                  }
                  catch (Exception ex)
                  {
                      Exception ex2 = ex;
                      string errorMessage = string.Empty;
                      while (ex2 != null)
                      {
                          errorMessage += ex2.ToString();
                          ex2 = ex2.InnerException;
                      }
                      message = "alert('Sending Failed...');";
                  }
                  return message;
              }
  
              public static string SendEmailWithFrom(string emailBody, string Subject, string emailTo, string ccEmailTo, string emailFrom) //TODO: Edit/Test
              {
                  string message = "";
                  try
                  {
                      System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
                      mail.To.Add(emailTo);
                      if (ccEmailTo != "")
                      {
                          mail.CC.Add(ccEmailTo);
                      }
                      mail.From = new MailAddress(emailFrom, Subject, System.Text.Encoding.UTF8);
                      mail.Subject = Subject;
                      mail.SubjectEncoding = System.Text.Encoding.UTF8;
                      mail.Body = emailBody;
                      mail.BodyEncoding = System.Text.Encoding.UTF8;
                      mail.IsBodyHtml = true;
                      mail.Priority = MailPriority.High;
                      SmtpClient client = new SmtpClient();
  
                      //TODO: Comment out
                      client.Port = 2525;
                      client.Host = "port80.smtpcorp.com";
                      client.Credentials = new System.Net.NetworkCredential("", "");
                      client.EnableSsl = true;
                      client.Send(mail);
                      message = "alert('Successfully Sent...');";
                  }
                  catch (Exception ex)
                  {
                      Exception ex2 = ex;
                      string errorMessage = string.Empty;
                      while (ex2 != null)
                      {
                          errorMessage += ex2.ToString();
                          ex2 = ex2.InnerException;
                      }
                      message = "alert('Sending Failed...');";
                  }
                  return message;
              }
  
  
              public static string SendEmail(string emailBody, string Subject, string emailTo, string ccEmailTo) //TODO: Edit/Test
              {
                  string message = "";
                  try
                  {
                      System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
                      mail.To.Add(emailTo);
                      if (ccEmailTo != "")
                      {
                          mail.CC.Add(ccEmailTo);
                      }
                      mail.From = new MailAddress("", Subject, System.Text.Encoding.UTF8);
                      mail.Subject = Subject;
                      mail.SubjectEncoding = System.Text.Encoding.UTF8;
                      mail.Body = emailBody;
                      mail.BodyEncoding = System.Text.Encoding.UTF8;
                      mail.IsBodyHtml = true;
                      mail.Priority = MailPriority.High;
                      //mail.Attachments.Add(new Attachment(HttpContext.Current.Server.MapPath("~/App_Code/ChristmasParty.pdf")));
                      SmtpClient client = new SmtpClient();
                      client.Port = 2525;
                      client.Host = "port80.smtpcorp.com";
                      client.Credentials = new System.Net.NetworkCredential("", "");
                      client.EnableSsl = true;
                      client.Send(mail);
                      message = "alert('Successfully Sent...');";
                  }
                  catch (Exception ex)
                  {
                      Exception ex2 = ex;
                      string errorMessage = string.Empty;
                      while (ex2 != null)
                      {
                          errorMessage += ex2.ToString();
                          ex2 = ex2.InnerException;
                      }
                      message="alert('Sending Failed...');";
                  }
                  return message;
              }
  
              public static string SendEmailWithAttachments(string emailBody, string Subject, string emailTo, string ccEmailTo, ArrayList strAttach) //TODO: Edit/Test
              {
                  string message = "";
                  try
                  {
                      System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
                      //mail.To.Add(emailTo);
                      mail.To.Add("");
                      if (ccEmailTo != "")
                      {
                          mail.CC.Add(ccEmailTo);
                      }
                      /*live on cartika*/
                      mail.From = new MailAddress("mailer@smtp.ibew.nf.ca", Subject, System.Text.Encoding.UTF8);
                      //mail.From = new MailAddress("diane@ibew.nf.ca", Subject, System.Text.Encoding.UTF8);
                      mail.Subject = Subject;
                      mail.SubjectEncoding = System.Text.Encoding.UTF8;
                      mail.Body = emailBody;
                      mail.BodyEncoding = System.Text.Encoding.UTF8;
                      mail.IsBodyHtml = true;
                      mail.Priority = MailPriority.High;
                      int i=0;
                      for (i = 0; i &lt;=  strAttach.Count - 1; i++)
                      {
                          mail.Attachments.Add(new Attachment(HttpContext.Current.Server.MapPath("~/usr/pdf/certs/" + strAttach[i].ToString())));
                      }
                      SmtpClient client = new SmtpClient();
                      client.Port = 587;
                      client.Host = "mail.smtp.ibew.nf.ca";
                      client.Credentials = new System.Net.NetworkCredential("", "");
                      client.Credentials = new System.Net.NetworkCredential("", "");
                      client.EnableSsl = false;
                      client.Send(mail);
                      client.Port = 2525;
                      client.Host = "port80.smtpcorp.com";
                      client.Credentials = new System.Net.NetworkCredential("", "");
                      client.EnableSsl = true;
                      client.Send(mail);
                      message = "alert('Successfully Sent...');";
                  }
                  catch (Exception ex)
                  {
                      Exception ex2 = ex;
                      string errorMessage = string.Empty;
                      while (ex2 != null)
                      {
                          errorMessage += ex2.ToString();
                          ex2 = ex2.InnerException;
                      }
                      message = "alert('Sending Failed...');";
                  }
                  return message;
              }
          }
      }
  </code></pre>