title: SendGrid Add Category to mail
body: <p>I am using SendGrid, and I want to add one or more category to the email, but the added category hadn't been sent!</p>
  
  <p>This is the code:</p>
  
  <pre><code>internal class Example
  {
      private static void Main()
      {
          Execute().Wait();
      }
  
      static async Task Execute()
      {
          //FYI, the following three variables are not real
          var apiKey = "SG.XXX";
          var fromEmail = "";
          var toEmail = "";
  
          var client = new SendGridClient(apiKey);
          var from = new EmailAddress(fromEmail);
          var subject = "Sending with SendGrid is Fun";
          var to = new EmailAddress(toEmail);
          var plainTextContent = "and easy to do anywhere, even with C#";
          var htmlContent = "&lt;strong&gt;and easy to do anywhere, even with C#&lt;/strong&gt;";
          var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
          msg.AddHeader("category", "cat1"); //This line does nothing!
          var response = await client.SendEmailAsync(msg);
      }
  }
  </code></pre>