I'm building a notification application using nodemailer and I keep getting this error:
[Error: 140735155404800:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:]
I am using a smtp server my job has. I'm an smtp noob so any help would be appreciated. I have sent email without any transport method but after a few emails the message object would then report my email being put in a "pending state":
{"accepted":[],"rejected":[],"pending":[{"domain":"xxxxx","exchange":"xxxx.xxxx",...
The above message occurs when I try to connect directly to the host as well.
Here is my code:
//import nodemailer
var nodemailer = require('nodemailer');
// create reusable transporter object using SMTP
var transporter = nodemailer.createTransport({
host: 'chelsmtp01.karmalab',
port: '25',
secure:true,
});
//email details
var mailOptions = {
from: 'XXX', // sender address
to: 'XXX', // list of receivers
subject: stitle, // Subject line
text: message, // plaintext body
html: message
};
// send mail with defined transport object
transporter.sendMail(mailOptions, function(error, info){
if(error)
return console.log(error);
console.log('Message sent: ' + JSON.stringify(info));
//transporter.close();
});
I have tried setting secure to false and then I get an invalid greeting error even if I set requireTLS true like some other forums have mentioned:
[Error: Invalid greeting from server:
554 chelmtp02.karmalab: 554 chelmtp02.karmalab]
code: 'EPROTOCOL',
response: '554 chelmtp02.karmalab',
responseCode: 554 }
EDIT: The SMPT server does not need user/password
EDIT: I can send email without a transport defined on my home network. I also managed to get my gmail to work as well. Could be a certificate or network issue
I'm building a notification application using nodemailer and I keep getting this error:
[Error: 140735155404800:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:]
I am using a smtp server my job has. I'm an smtp noob so any help would be appreciated. I have sent email without any transport method but after a few emails the message object would then report my email being put in a "pending state":
{"accepted":[],"rejected":[],"pending":[{"domain":"xxxxx.","exchange":"xxxx.xxxx.",...
The above message occurs when I try to connect directly to the host as well.
Here is my code:
//import nodemailer
var nodemailer = require('nodemailer');
// create reusable transporter object using SMTP
var transporter = nodemailer.createTransport({
host: 'chelsmtp01.karmalab',
port: '25',
secure:true,
});
//email details
var mailOptions = {
from: 'XXX', // sender address
to: 'XXX', // list of receivers
subject: stitle, // Subject line
text: message, // plaintext body
html: message
};
// send mail with defined transport object
transporter.sendMail(mailOptions, function(error, info){
if(error)
return console.log(error);
console.log('Message sent: ' + JSON.stringify(info));
//transporter.close();
});
I have tried setting secure to false and then I get an invalid greeting error even if I set requireTLS true like some other forums have mentioned:
[Error: Invalid greeting from server:
554 chelmtp02.karmalab: 554 chelmtp02.karmalab]
code: 'EPROTOCOL',
response: '554 chelmtp02.karmalab',
responseCode: 554 }
EDIT: The SMPT server does not need user/password
EDIT: I can send email without a transport defined on my home network. I also managed to get my gmail to work as well. Could be a certificate or network issue
Share edited Jun 9, 2016 at 7:04 asked Jun 8, 2016 at 19:45 user6442055user64420551 Answer
Reset to default 5Use secure:false in the configuration options if connecting to port 25. Using true indicates that you want to start a TLS connection but port 25 starts out as plaintext and gets upgraded later