nodejs smtp-server Email gets sent but not received

后端 未结 2 1497
广开言路
广开言路 2021-01-15 14:42
const nodemailer = require(\'nodemailer\');

const SMTPServer = require(\"smtp-server\").SMTPServer;

const server = new SMTPServer({
    onAuth(auth, session, callb         


        
2条回答
  •  余生分开走
    2021-01-15 15:19

    For who came with this same issue but using the Nodemailer's transporter way, I solved this issue adding the name of the server into the transporter object.

    
        const transportObj = {
          name: credentials.host, // in my case, the host and the name are the same
          host: credentials.host,
          port: credentials.port,
          secure: true,
          auth: {
              user: credentials.user,
              pass: credentials.pass
          },
    }
    
    const transporter = nodemailer.createTransport(transportObj)
    
    transporter.sendMail(...)
    
    

    This solution was related here

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题