title: 'SendGridMessage' does not contain a definition for 'Text' or 'Html' in .net mvc and SendGrid
body: <p>Im trying to integrate SendGrid in ASP.NET MVC project but got stuck while following the tutorial in the Microsoft page. </p>
  
  <pre><code>public class EmailService : IIdentityMessageService
  {
      public async Task SendAsync(IdentityMessage message)
      {
          await configSendGridasync(message);
      }
  
      // Use NuGet to install SendGrid (Basic C# client lib) 
      private async Task configSendGridasync(IdentityMessage message)
      {
          var myMessage = new SendGridMessage();
          myMessage.AddTo(message.Destination);
          myMessage.From = new EmailAddress(
                              "Joe@contoso.com", "Joe S.");
          myMessage.Subject = message.Subject;
          myMessage.Text =  message.Body;
          myMessage.Html = message.Body;
  
          var credentials = new NetworkCredential(
                     ConfigurationManager.AppSettings["mailAccount"],
                     ConfigurationManager.AppSettings["mailPassword"]
                     );
  
          // Create a Web transport for sending email.
          var transportWeb = new Web(credentials);
  
          // Send the email.
          if (transportWeb != null)
          {
              await transportWeb.DeliverAsync(myMessage);
          }
          else
          {
              Trace.TraceError("Failed to create Web transport.");
              await Task.FromResult(0);
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I put this code to App_Start folder with the name of <code>IdentitiyConfig.cs</code> but I get these two error messages: </p>
  
  <blockquote>
    <ul>
    <li><p>'SendGridMessage' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type
    'SendGridMessage'</p></li>
    <li><p>'SendGridMessage' does not contain a definition for 'Html' and no extension method 'Html' accepting a first argument of type
    'SendGridMessage'</p></li>
    </ul>
  </blockquote>
  
  <p>for the lines :</p>
  
  <pre><code>    myMessage.Text =  message.Body;
      myMessage.Html = message.Body;
  </code></pre>
  
  <p>I include these libraries:</p>
  
  <pre><code>using System;
  
  using System.Collections.Generic;
  
  using System.Linq;
  
  using System.Web;
  
  using SendGrid;
  
  using System.Net;
  
  using System.Configuration;
  
  using System.Diagnostics;
  
  using SendGrid.Helpers.Mail;
  
  using System.Threading.Tasks;
  
  using Microsoft.AspNet.Identity;
  
  using System.Web.UI;
  </code></pre>
  
  <p>I tried everything but couldnt come up with a solution. Appreciate for any help.</p>