user3699398
user3699398

Reputation: 551

I am Getting Strapi Email Api Error in Response : Internal Server Error

Getting "Internal Server Error" in response in Postman of Strapi Email API "http://localhost:1337/email"

In VS Code Debug Console i am also getting this:

Error: Cannot wrap non-Error object
    application.js:190
          at Object.exports.assert (f:\app\node_modules\hoek\lib\index.js:740:11)
          at Object.exports.wrap (f:\app\node_modules\boom\lib\index.js:95:10)
          at strapi.app.use (f:\app\node_modules\strapi\lib\middlewares\boom\index.js:40:20)
          at process._tickCallback (internal/process/next_tick.js:68:7)

Also Gave Permission to access email api and i can also debug it in VS Code but the result is an error.

        POST Call to "http://localhost:1337/email" with Body:

      {
           "to":"[email protected]",
           "from":"[email protected]",
           "replyTo": "[email protected]",
           "subject": "My message",
            "text": "Text"
        }

Result should be "OK" or "Email Sent"

Upvotes: 0

Views: 2719

Answers (1)

Jim LAURIE
Jim LAURIE

Reputation: 4120

I think it's because you use the default email provider (sendmail). And your computer is not an available smtp server.

So I suggest you to install strapi-email-nodemailer https://www.npmjs.com/package/strapi-email-nodemailer

Then in your admin panel, got to Plugins (menu link) > Email (cog icon) and the select nodemailer provider and set the smtp server you want to use.

If you have trouble to setup correct information I suggest you to check how nodemailer node module work. strapi-email-provider is just a connector to use nodemailer from Strapi.

Upvotes: 3

Related Questions