How do i setup SMTP with Loopback.io

前端 未结 1 506
别跟我提以往
别跟我提以往 2021-02-10 09:31

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

1条回答
  •  说谎
    说谎 (楼主)
    2021-02-10 09:52

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

    0 讨论(0)
提交回复
热议问题