title: Font size for an email sent using System.Net.Mail.SmtpClient
body: <p>I have an ASP.Net web application that's been tested extensively. One portion of it sends an email automatically using System.Net.Mail.SmtpClient. During testing, from various Windows 7 machines, the emails were sent and were formatted with a reasonable font size. I don't set the font size in the code, BTW. Now that the application's in production, the first email got sent in a very small font and the users want the font size increased. I can hard-code the font size of course, but I'd prefer to understand what's going on here. What determines the font size? Is it something in the SmtpClient, or some setting on the SMTP server, or what?  Below is the code that sends the email. TemplateEditor is an AjaxControlToolkit.HTMLEditor control on the page. AttyParaMessageBody is the variable that contains the email body. Our users are on Windows 7 with Outlook 2010.</p>
  
  <pre><code>string AttyParaMessageBody = TemplateEditor.Content;
  LHEmail.SendEmail(LHClassLibrary.LHConfigurationManager.AppSettings["ApprovedNewVersionLHEmailSubject"].ToString(), AttyParaMessageBody, AttyParaAddressees, CurrentLitHoldDetails.ResponsibleAttorney.Email, LHClassLibrary.LHConfigurationManager.AppSettings["EmailCCList"].ToString() + ";" + tbEmails.Text);
  
  public static void SendEmail(string subject, string body, string to, string from, string cc)
      {
          SendEmail(subject, body, to, from, cc, "", "", MailPriority.High);
      }
  
  public static void SendEmail(string subject, string body, string to, string from, string cc, string bcc, string fileName, MailPriority Priority)
      {
  
          MailMessage msgMail = new MailMessage();
          SmtpClient emailClient = new SmtpClient();
          try
          {
              msgMail = BuildMessage(subject, body, to, cc, bcc, from, fileName, Priority);
              emailClient.Send(msgMail);
          }
          catch (Exception ex)
          {
              string exception = ex.ToString();
          }
          finally
          {
              msgMail.Dispose();
          }
      }
  
  private static MailMessage BuildMessage(string subject, string body, string to, string cc, string bcc, string from, string fileName, MailPriority Priority)
      {
          MailMessage msgMail = new MailMessage();
  
          if (!to.Equals(string.Empty))
          {
              //format emails for .NET 4.0 version
              string[] toAddressList = to.Split(';');
  
              //Loads the To address field 
              foreach (string toaddress in toAddressList)
              {
                  if (toaddress.Length &gt; 0)
                  {
                      msgMail.To.Add(toaddress);
                  }
              }
  
              //optional args
              //format emails for .NET 4.0 version
              if (!cc.Equals(string.Empty))
              {
                  string[] ccAddressList = cc.Split(';');
  
                  //Loads the Cc address field 
                  foreach (string ccaddress in ccAddressList)
                  {
                      if (ccaddress.Length &gt; 0)
                      {
                          msgMail.CC.Add(ccaddress);
                      }
                  }
              }
              if (!bcc.Equals(string.Empty))
              {
                  string[] bccAddressList = bcc.Split(';');
  
                  //Loads the Bcc address field 
                  foreach (string bccaddress in bccAddressList)
                  {
                      if (bccaddress.Length &gt; 0)
                      {
                          msgMail.Bcc.Add(bccaddress);
                      }
                  }
              }
              if (!fileName.Equals(string.Empty))
                  msgMail.Attachments.Add(new Attachment(fileName));
  
              msgMail.Priority = Priority;
              msgMail.From = ((from == null) || (from.Equals(string.Empty))) ? new MailAddress("LitHold@kramerlevin.com", "Litigation Hold") : new MailAddress(from, "Litigation Hold");
              msgMail.Subject = subject;
              msgMail.Body = body;
              msgMail.IsBodyHtml = true;
  
          }
          else { throw new SmtpFailedRecipientException("Failed to provide destination address"); }
          return msgMail;
      }
  </code></pre>