Forgot-password --- No email received (Strapi V4)

Hi all,

I’m facing some issue when trying to test the admin forgot-password api on Postman.

Issue 1: Unable to receive the password recovery email after getting the path properly set on Postman.

Issue 2: Testing all unrelated email address (not in the users’ data entry) will always return { ok: true }.

Issue 3: Testing the email delivery with the default email setting will return a error of “success: Failed to send a test mail to abc@gmail.com”.

Basically all the email related setting from Strapi Admin panel were remain unchanged.

Is there any setting that I’ve missed out that caused the issues?

Thanks!





You will need to reference this

You will need to set the configuration in config/plugins.js

module.exports = ({ env }) => ({
  email: {
    logger: {
      debug: console.log,
      info: console.info,
      warn: console.warn,
      error: console.error
    },
    config: {
      provider: 'sendmail',
      settings: {
        defaultFrom: 'your-email@email.com',
        defaultReplyTo: 'your-email@email.com',
      },
    },
  },
});

You will need to add all the appropriate options for sendmail. You can reference the sendmail docs here. @strapi/provider-email-sendmail - npm

But I believe for it to work you would need to have a email server running locally. Which is something I am not familiar with.

I typically use node-mailer or sendgrid they are much easier to setup.

Here is a video that covers sendgrid set up, the demo is using Strapi Cloud but the setup steps are the same when setting it up locally.

Hi Paul, thanks for the prompt reply.

Q1) Is sendmail the default email provider from Strapi v4 once setup is completed?

Q2) Just wonder if the configuration in the config/plugin.js is a must to receive the password reset email?
I had a project with Strapi v3, but it seems like nothing to configure when testing the forgot-password function and to receive the reset email? Please correct me if I’m wrong.

Q3) If the Q2 is necessary, I’d prefer using node-mailer. Do I need to manually select the email provider to node-mailer in the Strapi admin panel email configuration after installing @strapi/provider-email-nodemailer ?

Strapi is an application that runs on a web server, which is using Node.

For emails to work, it requires an email server to manage the handshakes between itself and another mail server. Sendmail is an integration between the web server and the email server.

The easiest solution in my opinion, if your web server doesn’t have an email server, is to use an existing email server via SMTP, AWS SNS or the equivalents on other cloud platforms.

To help you further, where will you host your Strapi server?

Hi Paul,

I have installed the email provider below in my Nextjs project
@strapi/provider-email-nodemailer”: “^4.16.2”

And using a gmail which set as a smtp to send email. It is tested working with the details in the frontend pages.

But the issue is it is still not able to send any test mail from the Strapi admin panel. It will always show the error of “Failed to send test mail …”.
Is there anything I have missed out to configure that caused the error?

.env
.env

config/plugins.js

test mail

error
email error

I am facing the same too. Have you finally solved that issue?

My test email is working but when I click on forgot password and send email. It just call the api /admin/forgot-password but does nothing. No mail was sent from smtp mail account.