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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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"
}
}
]
},
Or:
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"
}
});