title: E-mail is not send with ASP.NET Identity Framework
body: <p>I am having this code to send e-mail to reset user password:</p>
  
  <pre><code>//
          // POST: /Account/ForgotPassword
          [HttpPost]
          [AllowAnonymous]
          [ValidateAntiForgeryToken]
          public async Task&lt;JsonResult&gt; ForgotPassword(ForgotPasswordViewModel model, bool CaptchaValid)
          {
              string mensaje = String.Empty;
  
              if (ModelState.IsValid)
              {
                  if (!CaptchaValid)
                      mensaje = "ERROR: Captcha inválido.";
                  else
                  {
                      var user = await UserManager.FindByEmailAsync(model.Email);
                      if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id)))
                      {
                          mensaje = "ERROR: La dirección de correo electrónico no está registrada.";
                      }
                      else
                      {
                          var provider = new DpapiDataProtectionProvider("WebAttendance");
                          UserManager.UserTokenProvider = new DataProtectorTokenProvider&lt;ApplicationUser, string&gt;(provider.Create("UserToken")) as IUserTokenProvider&lt;ApplicationUser, string&gt;;
                          string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
                          var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                          await UserManager.SendEmailAsync(user.Id, "Reset Password", "Por favor, cambie su contraseña al hacer click &lt;a href=\"" + callbackUrl + "\"&gt;aquí&lt;/a&gt;");
                          return Json("INFO: Se envió un mail a su cuenta de correo con instrucciones para cambiar su contraseña.");
                      }
                  }
              }
  
              // If we got this far, something failed, redisplay form
              return Json(mensaje);
          }
  </code></pre>
  
  <p>The above code runs without any error, but e-mail is not actually sent.</p>
  
  <p>This is the Web.config entries:</p>
  
  <pre><code>  &lt;system.net&gt;
      &lt;mailSettings&gt;
        &lt;smtp from="info@xxx.com"&gt;
          &lt;network host="mail.desytec.cl" password="xxxx" port="587" userName="yyy@xxx.cl"  enableSsl="false"/&gt;
        &lt;/smtp&gt;
      &lt;/mailSettings&gt;
    &lt;/system.net&gt;
  </code></pre>
  
  <p>By the way, when reading some posts, I knew that I have to have IdentityConfig.cs file in App_Start, but that file is missing. May this be the cause?</p>