在数字海洋服务器上使用 nodemailer 使用节点发送电子邮件

时间:2021-03-03 00:46:32

标签: node.js email nodemailer

我正在使用以下函数发送带有节点的电子邮件

   Mail.sendMail({
     to: `${obj.nome} <${obj.email}>`,
     subject: 'Process Status',
     template: 'processStatus',
     context: {
         nome: obj.name,
         processo: processNumber,
         descricao_status: req.body.status,
     },
    });
            

这些是我的 .env 文件中的 SMTP 设置

MAIL_HOST=email-ssl.com.br
MAIL_PORT=465:1
MAIL_USER= ...
MAIL_PASS= ...

当我用我的机器在本地测试发送电子邮件时,我可以正确发送电子邮件,但是在服务器上使用直接发送时,我使用的是digitalocean,它不起作用,有没有人知道什么可以是?或者我可以检查什么?

另一个问题是,为什么我必须使用这个:1?已经测试过没有相同并且不起作用

0 个答案:

没有答案