2013-10-22 100 views
10

我正在像这样创建传输对象。无法使用Nodemailer连接到outlook.com SMTP

var transport = nodemailer.createTransport("SMTP", { 
     host: "smtp-mail.outlook.com", // hostname 
     secureConnection: false, // use SSL 
     port: 587, // port for secure SMTP 
     auth: { 
      user: "[email protected]", 
      pass: "password" 
     } 
    }); 

这是我收到的时候我尝试发送邮件的错误。

[Error: 139668100495168:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:337: ]

当我尝试将ignoreTLS设置为true时。这是我正在得到

{ [AuthError: Invalid login - 530 5.7.0 Must issue a STARTTLS command first] name: 'AuthError', data: '530 5.7.0 Must issue a STARTTLS command first' }

我做错了什么?请帮忙。

回答

20

我有同样的问题,直到我偶然发现https://github.com/andris9/Nodemailer/issues/165

尝试添加TLS使用的SSLv3加密选项。

var transport = nodemailer.createTransport("SMTP", { 
    host: "smtp-mail.outlook.com", // hostname 
    secureConnection: false, // TLS requires secureConnection to be false 
    port: 587, // port for secure SMTP 
    auth: { 
     user: "[email protected]", 
     pass: "password" 
    }, 
    tls: { 
     ciphers:'SSLv3' 
    } 
}); 

另外,为的Hotmail /现场/ Outlook中,您可以简单地使用

var transport = nodemailer.createTransport("SMTP", { 
    service: "hotmail", 
    auth: { 
     user: "[email protected]", 
     pass: "password" 
    } 
}); 
+1

+1'服务 “的Hotmail”' – Shouvik

+0

我想你忘了删除第一个参数, “SMTP”,在'的服务: “Hotmail的”'例子。 – michalstanko

-2

TLS:{ 密码: 'SSLv3的' } +1工作

和第一AGR( “SMTP”,不支持更高版本。一个将不得不降级nodemailler

0

如果您使用的是Nodemailer 1.x或gr吃你可以使用:

var transporter = nodemailer.createTransport('smtp://username%40outlook.com:[email protected]'); 
相关问题