最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

SMTP连接

IT培训 admin 11浏览 0评论

SMTP连接

我正在尝试通过smtp发送邮件,但我无法这样做。它给了我连接错误

 { Error: connect EACCES xx.xxx.xx.xx:25
 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
  errno: 'EACCES',
  code: 'ECONNECTION',
  syscall: 'connect',
  address: 'xx.xxx.xx.xx',
  port: 25,
  command: 'CONN' }

虽然我正在传递的配置是正确的,因为我正在另一个项目中传递相同的配置。

这两个项目可能在不同的服务器上,您能以同样的方式指导我吗。我被困了两天]

这里是配置以供参考

var transport = nodemailer.createTransport( {
            debug: true,
            host: "smtp.xx.xxx",
            port: 25,
            secure: false,
            auth: {
                user: 'xxxxxxxx',
                pass:'xxxxxxxxx'
            },
            tls: {
                rejectUnauthorized: false,
            }
        } );
        transport.verify(function (error, success) {
            if (error) {
                console.log('====>' + error);
            } else if (success) {
                console.log("Server is ready to take our messages");
            }
        });
    

我正在尝试通过smtp发送邮件,但我无法这样做。它给了我连接错误{错误:在TCPConnectWrap.afterConnect上连接EACCES xx.xxx.xx.xx:25 [完成时](net.js:1117:14)...

回答如下:
var transport = nodemailer.createTransport( {
        debug: true,
        host: "smtp.xx.xxx",
        port: 25,
        secure: false,
        tls: {
            rejectUnauthorized: false,
        }
    } );
    transport.verify(function (error, success) {
        if (error) {
            console.log('====>' + error);
        } else if (success) {
            console.log("Server is ready to take our messages");
        }
    });

SMTP连接

我正在尝试通过smtp发送邮件,但我无法这样做。它给了我连接错误

 { Error: connect EACCES xx.xxx.xx.xx:25
 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
  errno: 'EACCES',
  code: 'ECONNECTION',
  syscall: 'connect',
  address: 'xx.xxx.xx.xx',
  port: 25,
  command: 'CONN' }

虽然我正在传递的配置是正确的,因为我正在另一个项目中传递相同的配置。

这两个项目可能在不同的服务器上,您能以同样的方式指导我吗。我被困了两天]

这里是配置以供参考

var transport = nodemailer.createTransport( {
            debug: true,
            host: "smtp.xx.xxx",
            port: 25,
            secure: false,
            auth: {
                user: 'xxxxxxxx',
                pass:'xxxxxxxxx'
            },
            tls: {
                rejectUnauthorized: false,
            }
        } );
        transport.verify(function (error, success) {
            if (error) {
                console.log('====>' + error);
            } else if (success) {
                console.log("Server is ready to take our messages");
            }
        });
    

我正在尝试通过smtp发送邮件,但我无法这样做。它给了我连接错误{错误:在TCPConnectWrap.afterConnect上连接EACCES xx.xxx.xx.xx:25 [完成时](net.js:1117:14)...

回答如下:
var transport = nodemailer.createTransport( {
        debug: true,
        host: "smtp.xx.xxx",
        port: 25,
        secure: false,
        tls: {
            rejectUnauthorized: false,
        }
    } );
    transport.verify(function (error, success) {
        if (error) {
            console.log('====>' + error);
        } else if (success) {
            console.log("Server is ready to take our messages");
        }
    });

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论