title: SendGrid is not sending an email
body: <p>I have been following this tutorial: <a href="http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-web-app-with-email-confirmation-and-password-reset" rel="nofollow">http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-web-app-with-email-confirmation-and-password-reset</a> . I have gone through it three times now and checked through several Stackoverflow posts, but I still don't know what I am missing. Through debugging Visual Studio shows that myMessage has all that it needs (email address to deliver to, message subject, message body, who it is coming from, etc), but I am not actually receiving an email for confirmation when I test it. This is the code I currently have: </p>
  
  <p>IdentityConfig.cs</p>
  
  <pre><code>public class EmailService : IIdentityMessageService
  {
      public async Task SendAsync(IdentityMessage message)
      {
          // Plug in your email service here to send an email.
          // line below was commented out and replaced upon tutorial request
          //return Task.FromResult(0);
          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 System.Net.Mail.MailAddress(
                              "myActualEmail@email.com", "Robert");
          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>AccountController: </p>
  
  <pre><code>[HttpPost]
      [AllowAnonymous]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Register(RegisterViewModel model)
      {
          if (ModelState.IsValid)
          {
              var user = new ApplicationUser { UserName = model.UserName, Email = model.Email };
              var result = await UserManager.CreateAsync(user, model.Password);
              if (result.Succeeded)
              {
                  // commented below code and RedirectToAction out so it didn't auto log you in.
                  //await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
  
                  //For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                  //Send an email with this link
                  string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                  var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                  await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking &lt;a href=\"" + callbackUrl + "\"&gt;here&lt;/a&gt;");
  
                  ViewBag.Message = "Check your email and confirm your account, you must be confirmed before you can log in.";
  
                  return View("Info");
  
                  //return RedirectToAction("Index", "Home");
              }
              AddErrors(result);
          }
  
          // If we got this far, something failed, redisplay form
          return View(model);
      }
  </code></pre>
  
  <p>Web.config: </p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="webpages:Version" value="3.0.0.0" /&gt;
  
      &lt;add key="webpages:Enabled" value="false" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  
      &lt;add key="mailAccount" value="azure_d8aedad6a68a0dc1dc8axxxxxxxxxxxx@azure.com" /&gt; &lt;!--the mailAccount that SendGrid gave me through Azure marketplace to use--&gt;
      &lt;add key="mailPassword" value="xxxxxx" /&gt; &lt;!--password taken out, but I used the one from SendGrid--&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>The code builds and runs with no errors, but I never get the actual email when I test it (I have used two separate gmail accounts and a yahoo account). Any advice/help would be appreciated!</p>