1

This is my first time doing email verification,i followed a tutorial which used papercut and an example email,but i wanted to try do this with an actual gmail but i get the following error:The SMTP server does not support authentication. When using email verification with identit

i assume there something wrong with my json file

"Email": {
    "Server": "smtp.gmail.com",
    "Port": 587,
    "SenderName": "LoveLetter",
    "SenderEmail": "crunchgymemailbot@gmail.com",
    "Account": "emailbot3123***@gmail.com",
    "Password": "mypassword"
  },"

here is a part of my register code

  if (result.Succeeded)  {
        var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);

            var link = Url.Action(nameof(VerifyEmail), "Home", new { userId = user.Id, code }, Request.Scheme, Request.Host.ToString());

          code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));

          await _emailService.SendAsync(model.Email, "email verify", $"<a href=\"{link}\">Verify Email</a>", true);

          return RedirectToAction("EmailVerification");
                    }

and my startup.cs

var mailKitOptions = Configuration.GetSection("Email").Get<MailKitOptions>();
            services.AddMailKit(config => config.UseMailKit(mailKitOptions));
Turqay Umudzade
  • 171
  • 2
  • 13

0 Answers0