I am creating the transport object like this.
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"
}
});
This is the error which I am getting.
[Error: 139668100495168:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:337:
]
When I tried setting ignoreTLS as true. This is what I am getting
{ [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' }
Am I doing something wrong? Please help.
Debug log shows like this.
SERVER 1:
└──220 BLU0-SMTP66.phx.gbl Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Wed, 23 Oct 2013 00:47:41 -0700
CLIENT 1:
└──EHLO [127.0.0.1]
SERVER 1:
└──250-BLU0-SMTP66.phx.gbl Hello [202.191.170.90]
250-TURN
250-SIZE 41943040
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-TLS
250-STARTTLS
250 OK
CLIENT 1:
└──STARTTLS
SERVER 1:
└──220 2.0.0 SMTP server ready
Connection secured
CLIENT 1:
└──EHLO [127.0.0.1]
SERVER 1:
└──250-BLU0-SMTP66.phx.gbl Hello [202.191.170.90]
250-TURN
250-SIZE 41943040
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-AUTH LOGIN PLAIN XOAUTH2
250 OK
CLIENT 1:
└──AUTH PLAIN some-char-here
You should probably use similar settings as the Hotmail predefined service, especially see the tls
option.
Perfect. :+1:
@andris9 hi, the link in your reply doesn't work got 404 github page
What is the recommended 'service' to use for an Exchange Outlook email address?
Anything I've tried (smtp-mail.outlook.com, outlook.office365.com, ...) always attempts to start the login process with AUTH START after EHLO and STARTTLS, but then fails with:
"Authentication unsuccessfull. User 'theuser@domain' failed to authenticate"
I've more than quadruple checked the user and password given in auth by using them to login to outlook and exchange. + setup an exchange connector for both incoming and outgoing mail.
Also, as @curlynux said, the link pointing towards the Hotmail predefined service returns a 404.
Info:
@curlynux @ThorrStevens
Not sure if you guys have figured it out, but I am guessing that the "Hotmail predefined service" looks like this:
var transporter = nodemailer.createTransport({
service: 'hotmail',
auth: {
user: config.alertEmail,
pass: config.alertEmailPassword
}
});
I am able to send and receive emails using outlook.
Most helpful comment
@andris9 hi, the link in your reply doesn't work got 404 github page