I am going to send mail in nodejs. So I have installed emailjs. I have configured the script as the followings.
emailjs = require('emailjs');
var server = emailjs.server.connect({
user:"my gmail address",
password:"gmail passs word",
host:"smtp.gmail.com",
ssl:true,
port: 456
});
server.send({
text: "message",
from:"LLVC <my outlook mail>",
to:"<my outlook mail>",
subject:"Subject"
},
function (err, message) {
console.log(err || message);
});
But I got the errors
{ [Error: timedout while connecting to smtp server] code: 4, smtp: undefined }
I want to fix them. Thanks.
It's port 465, not 456.
If you tried configuring your SMTP server on port 465 (with SSL) and port 587 (with TLS), but are still having trouble sending mail, try configuring your SMTP to use port 25 (with SSL).
https://support.google.com/mail/answer/78775?hl=en
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With