如何使用Loopback.io设置SMTP [英] How do i setup SMTP with Loopback.io
本文介绍了如何使用Loopback.io设置SMTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用loopback.io mbaas设置SMTP服务器?我已经阅读了所有文档,但找不到. 如果可以的话,如何在回送配置文件中提供/定义我的smtp服务器设置.
How to setup SMTP server with loopback.io mbaas? i have gone through all the documentation but i couldn't find it. How to give/define my smtp server settings in loopback config file if there is way to do so.
推荐答案
可以在datasources.json中配置STMP传输,例如:
The STMP transport can be configured in the datasources.json, for example:
"mail": {
"defaultForType": "mail",
"connector": "mail",
"transports": [ {
type: 'SMTP',
host: "smtp.gmail.com", // hostname
secureConnection: true, // use SSL
port: 465, // port for secure SMTP
auth: {
user: "gmail.user@gmail.com",
pass: "userpass"
}
}
]
},
或者:
app.models.email.setupTransport({
type: 'SMTP',
host: "smtp.gmail.com", // hostname
secureConnection: true, // use SSL
port: 465, // port for secure SMTP
auth: {
user: "gmail.user@gmail.com",
pass: "userpass"
}
});
这篇关于如何使用Loopback.io设置SMTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文