title: The type or namespace name 'SendGridClient' could not be found in Azure function
body: <p>I want to send email using SendGrid using Azure function. I am using c# code to do it. Below is my sample code. When I compile the code, I am getting below error,</p>
  
  <pre><code>#r "System.Configuration"
  #r "System.Data"
  #r "SendGrid"
  
  using System;
  using System.Net;
  using System.Configuration;
  using SendGrid;
  using SendGrid.Helpers.Mail;
  
  public static async Task &lt; HttpResponseMessage &gt; Run(HttpRequestMessage req, TraceWriter log) {
  
           var client = new SendGridClient(sendgridApiKey);
           var msg = new SendGridMessage()
           {
               From = new EmailAddress("sample@gmail.com", "DX Team"),
               Subject = "Hello World from the SendGrid CSharp SDK!",
               PlainTextContent = "Hello, Email!",
               HtmlContent = "&lt;strong&gt;Hello, Email using HTML!&lt;/strong&gt;"
           };
           var recipients = new List&lt;EmailAddress&gt;
           {
               new EmailAddress("test@gmail.com", "John"),
               new EmailAddress("sa@gmail.com", "Sam")
           };
          msg.AddTo(recipients);
           msg.SetFooterSetting(
                        true,
                        "Some Footer HTML",
                        "&lt;strong&gt;Some Footer Text&lt;/strong&gt;");
          var response = await client.SendEmailAsync(msg);
  }
  </code></pre>
  
  <p>Error:-</p>
  
  <pre><code>The type or namespace name 'SendGridClient' could not be found (are you missing a using directive or an assembly reference?)
  The type or namespace name 'SendGridMessage' could not be found (are you missing a using directive or an assembly reference?)
  The type or namespace name 'EmailAddress' could not be found (are you missing a using directive or an assembly reference?)
  The type or namespace name 'EmailAddress' could not be found (are you missing a using directive or an assembly reference?)
  The type or namespace name 'EmailAddress' could not be found (are you missing a using directive or an assembly reference?)
  The type or namespace name 'EmailAddress' could not be found (are you missing a using directive or an assembly reference?)
   Compilation failed.
  </code></pre>
  
  <p>My references is <a href="https://docs.microsoft.com/en-us/azure/app-service-web/sendgrid-dotnet-how-to-send-email" rel="nofollow noreferrer">here</a></p>
  
  <p>How do I solve this?</p>