我在响应中收到 Strapi 电子邮件 Api 错误:内部服务器错误 [英] I am Getting Strapi Email Api Error in Response : Internal Server Error
问题描述
在 Strapi 电子邮件 API 的邮递员响应中收到内部服务器错误""http://localhost:1337/email"
Getting "Internal Server Error" in response in Postman of Strapi Email API "http://localhost:1337/email"
在 VS Code 调试控制台中,我也得到了这个:
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":"asdf@yahoo.com",
"from":"zxcv@yopmail.com",
"replyTo": "zxcv@yopmail.com",
"subject": "My message",
"text": "Text"
}
结果应该是OK"或Email Sent"
Result should be "OK" or "Email Sent"
推荐答案
我认为这是因为您使用了默认的电子邮件提供商 (sendmail).并且您的计算机不是可用的 smtp 服务器.
I think it's because you use the default email provider (sendmail). And your computer is not an available smtp server.
所以我建议你安装 strapi-email-nodemailer
https://www.npmjs.com/package/strapi-email-nodemailer
然后在您的管理面板中,转到插件(菜单链接)> 电子邮件(齿轮图标)和选择 nodemailer 提供商并设置您要使用的 smtp 服务器.
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.
如果您无法设置正确的信息,我建议您检查 nodemailer
节点模块的工作方式.strapi-email-provider
只是一个连接器,用于使用来自 Strapi 的 nodemailer
.
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.
这篇关于我在响应中收到 Strapi 电子邮件 Api 错误:内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!