Unable to sent mail using nodemailer











up vote
-1
down vote

favorite












I am using node.js version 8.9.1 and nodemailer version 4.6.8. Below is my
code. I am using fake SMTP. SMTP details and port no received from my
network team.when i run the code i am getting the following error.Can anyone help me to come out from this.



Error is : `{ Error: connect EACCES 10.219.3.18:25
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNECTION',
errno: 'EACCES',
syscall: 'connect',
address: '10.219.3.18',
port: 25,
command: 'CONN' }`

Below is my code.




'use strict';
const nodemailer = require('nodemailer');
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host : "10.219.3.18", //received from n/w team & enabled access for my ip
port: 25,//received from n/w team & enabled access for my ip
secure: false, // true for 465, false for other ports
auth: {
user : "someemailid@domain.com",
pass : "somepassword"
}
});

// setup email data with unicode symbols
let mailOptions = {
from : "someemailid@domain.com",
to : "someemailid@domain.com,someemailid2@domain.com",
subject: 'Hello ✔', // Subject line
text: 'Hello world?', // plain text body
html: '<b>Hello world?</b>' // html body
};

// verify connection configuration
transporter.verify(function(error, success) {
if (error) {
console.log(error);
} else {
console.log('Server is ready to take our messages');
}
});



// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log('Message sent: %s', info.messageId);

});
});









share|improve this question






















  • Seems like port 25 is either firewalled or not accepting connections at that particular IP. Test with something like telnet or nmap first.
    – tadman
    Nov 8 at 4:45















up vote
-1
down vote

favorite












I am using node.js version 8.9.1 and nodemailer version 4.6.8. Below is my
code. I am using fake SMTP. SMTP details and port no received from my
network team.when i run the code i am getting the following error.Can anyone help me to come out from this.



Error is : `{ Error: connect EACCES 10.219.3.18:25
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNECTION',
errno: 'EACCES',
syscall: 'connect',
address: '10.219.3.18',
port: 25,
command: 'CONN' }`

Below is my code.




'use strict';
const nodemailer = require('nodemailer');
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host : "10.219.3.18", //received from n/w team & enabled access for my ip
port: 25,//received from n/w team & enabled access for my ip
secure: false, // true for 465, false for other ports
auth: {
user : "someemailid@domain.com",
pass : "somepassword"
}
});

// setup email data with unicode symbols
let mailOptions = {
from : "someemailid@domain.com",
to : "someemailid@domain.com,someemailid2@domain.com",
subject: 'Hello ✔', // Subject line
text: 'Hello world?', // plain text body
html: '<b>Hello world?</b>' // html body
};

// verify connection configuration
transporter.verify(function(error, success) {
if (error) {
console.log(error);
} else {
console.log('Server is ready to take our messages');
}
});



// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log('Message sent: %s', info.messageId);

});
});









share|improve this question






















  • Seems like port 25 is either firewalled or not accepting connections at that particular IP. Test with something like telnet or nmap first.
    – tadman
    Nov 8 at 4:45













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I am using node.js version 8.9.1 and nodemailer version 4.6.8. Below is my
code. I am using fake SMTP. SMTP details and port no received from my
network team.when i run the code i am getting the following error.Can anyone help me to come out from this.



Error is : `{ Error: connect EACCES 10.219.3.18:25
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNECTION',
errno: 'EACCES',
syscall: 'connect',
address: '10.219.3.18',
port: 25,
command: 'CONN' }`

Below is my code.




'use strict';
const nodemailer = require('nodemailer');
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host : "10.219.3.18", //received from n/w team & enabled access for my ip
port: 25,//received from n/w team & enabled access for my ip
secure: false, // true for 465, false for other ports
auth: {
user : "someemailid@domain.com",
pass : "somepassword"
}
});

// setup email data with unicode symbols
let mailOptions = {
from : "someemailid@domain.com",
to : "someemailid@domain.com,someemailid2@domain.com",
subject: 'Hello ✔', // Subject line
text: 'Hello world?', // plain text body
html: '<b>Hello world?</b>' // html body
};

// verify connection configuration
transporter.verify(function(error, success) {
if (error) {
console.log(error);
} else {
console.log('Server is ready to take our messages');
}
});



// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log('Message sent: %s', info.messageId);

});
});









share|improve this question













I am using node.js version 8.9.1 and nodemailer version 4.6.8. Below is my
code. I am using fake SMTP. SMTP details and port no received from my
network team.when i run the code i am getting the following error.Can anyone help me to come out from this.



Error is : `{ Error: connect EACCES 10.219.3.18:25
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNECTION',
errno: 'EACCES',
syscall: 'connect',
address: '10.219.3.18',
port: 25,
command: 'CONN' }`

Below is my code.




'use strict';
const nodemailer = require('nodemailer');
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host : "10.219.3.18", //received from n/w team & enabled access for my ip
port: 25,//received from n/w team & enabled access for my ip
secure: false, // true for 465, false for other ports
auth: {
user : "someemailid@domain.com",
pass : "somepassword"
}
});

// setup email data with unicode symbols
let mailOptions = {
from : "someemailid@domain.com",
to : "someemailid@domain.com,someemailid2@domain.com",
subject: 'Hello ✔', // Subject line
text: 'Hello world?', // plain text body
html: '<b>Hello world?</b>' // html body
};

// verify connection configuration
transporter.verify(function(error, success) {
if (error) {
console.log(error);
} else {
console.log('Server is ready to take our messages');
}
});



// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log('Message sent: %s', info.messageId);

});
});






node.js nodemailer






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 4:43









pradeep

558




558












  • Seems like port 25 is either firewalled or not accepting connections at that particular IP. Test with something like telnet or nmap first.
    – tadman
    Nov 8 at 4:45


















  • Seems like port 25 is either firewalled or not accepting connections at that particular IP. Test with something like telnet or nmap first.
    – tadman
    Nov 8 at 4:45
















Seems like port 25 is either firewalled or not accepting connections at that particular IP. Test with something like telnet or nmap first.
– tadman
Nov 8 at 4:45




Seems like port 25 is either firewalled or not accepting connections at that particular IP. Test with something like telnet or nmap first.
– tadman
Nov 8 at 4:45

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53201669%2funable-to-sent-mail-using-nodemailer%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53201669%2funable-to-sent-mail-using-nodemailer%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini