Search code examples
strapi

Send emails using Strapi


I have not understood how the Strapi email plugin works.:(

If I only use Strapi-Sendmail, how do I send a mail from Localhost over port 25 so that I can test locally if my Strapi sends mail?

Why does the recipient("to") have to be "admin@strapi.io"? I can enter any sender, if I use PHP. A little introduction would be helpful!

Setting on "Public" just for test: enter image description here

In "Email.js":

enter image description here

Tested via Postman:

enter image description here

I read this article, unfortunately I have not completely understood yet. Send mails


Solution

  • It sounds that Strapi default sendmail provider doesn't work locally. You should create an account on http://sendgrid.com, generate an API key and install npm library on your server : npm i strapi-provider-email-sendgrid

    At last you choose sendgrid provider in Strapi, enter your API key and enjoy !

    strapi