How can I fix email confirmation - in .NET Core, it doesn't work

后端 未结 2 1883
灰色年华
灰色年华 2020-12-21 07:54

I already have a register action

public async Task OnPostAsync(string returnUrl = null)
{
            var useremail = _userManager.User         


        
相关标签:
2条回答
  • 2020-12-21 08:34

    "Solved" I asked Sendgrid, and I was told that I cannot use my yahoo email (or gmail,...) as the sender email; this is part of the answer: "Yahoo observes an email security standard called DMARC. DMARC instructs email providers to reject messages where the From domain is a Yahoo domain, but the message originates from a non-approved domain server/service." So I need to use my own mail domain;

    0 讨论(0)
  • 2020-12-21 08:44

    When I create a new web application with individual user accounts, this works perfectly, but I noticed that when you scaffold identity and override all pages to have control into an existing app, the behavior you are experiencing is the usual.

    Here is how I fixed it:

    If you open the file Areas/Identity/Pages/Account/RegisterConfirmation.cshtml.cs look for the comment Once you add a real email sender, you should remove this code that lets you confirm the account, comment everything below that line before the return Page() statement and that should do the job.

    0 讨论(0)
提交回复
热议问题