8

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

Benjamin Reeves
  • 553
  • 3
  • 6
  • 19

2 Answers2

10

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

vinzcelavi
  • 831
  • 9
  • 10
  • Thank you very much for your answer, I will try it this week! :) – Benjamin Reeves Aug 04 '19 at 12:04
  • 1
    Thanks again for your answer and suggestion. Sendgrid works very well! – Benjamin Reeves Mar 27 '20 at 09:41
  • Thanks, worked for me. Take in count that SendGrid requires you to perform either a Domain Authentication or Single Sender Verification and when testing your implementation you have to use a sender from that same domain or equal to your configured Single Sender, other ways you will get a non-related code error. – CoderPug May 11 '20 at 04:54
  • 1
    Hi, I cannot find "Email - Settings" page in strapi admin. How can I navigate to it? I use strapi 3.0.1 – podeig Jun 12 '20 at 14:24
  • 2
    Hi, @podeig after release 3.0.0 Strapi removed UI for Email - Settings. Now you can make all configuration into code. All you need to install package you want to use: mailgun, nodemailer ..., create file config/plugins.js and add configuration you want. Below I'm adding sample configuration: https://pastebin.com/M1NMH7nG – Stefan Popovski Jul 23 '20 at 08:58
2

Yes it worked for me. Create an account on Sendgrid and enter your secret ID it should work.

vinzcelavi
  • 831
  • 9
  • 10
  • 1
    Thank you very much for your answer, it's time to continue my Strapi project. :) I will test with Sendgrid and report the result as soon as possible. Best regards! – Benjamin Reeves Nov 05 '19 at 21:20
  • @vinzcelavi I am trying to follow the steps you mentioned here. I am getting 401 error when trying to use forgot password api. Can you please tell me what will be my to and from field. I already have key. – RAHUL KUNDU Dec 07 '19 at 04:30