How do i setup SMTP with Loopback.io

ぃ、小莉子 提交于 2019-12-04 13:35:48

问题


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"
       }
   });


来源:https://stackoverflow.com/questions/24620394/how-do-i-setup-smtp-with-loopback-io

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!