How to send encrypted/TLS emails with NodeJS from localhost using send mail
up vote
0
down vote
favorite
I want to be able to send emails from my local domain without using gmail or other SMTP servers.
I'm currently using SendMail:
const sendmail = require('sendmail') ({
logger: {
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error
},
dkim: {
privateKey: dkimPrivateKey,
keySelector: 'default'
},
});
sendmail({
from: 'foo@mydomain.com',
to: 'mygmail@gmail.com',
subject: 'test sendmail',
html: 'Mail of test sendmail ',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
and this DOES work, BUT when I receive the email in my Gmail account, and I view the message information, Google is marking this as 'security: No encryption'
From what I understand I need to use TLS to create a 'secure' connection. I already have a certificate and keys from LetsEncrypt and my domain is already using HTTPS. How do I encrypt/use TLS my outgoing emails?
Or is there a better package for this? I've tried using NodeMailer and my emails only get added to a 'queue' and never sent.
ssl smtp lets-encrypt nodemailer starttls
add a comment |
up vote
0
down vote
favorite
I want to be able to send emails from my local domain without using gmail or other SMTP servers.
I'm currently using SendMail:
const sendmail = require('sendmail') ({
logger: {
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error
},
dkim: {
privateKey: dkimPrivateKey,
keySelector: 'default'
},
});
sendmail({
from: 'foo@mydomain.com',
to: 'mygmail@gmail.com',
subject: 'test sendmail',
html: 'Mail of test sendmail ',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
and this DOES work, BUT when I receive the email in my Gmail account, and I view the message information, Google is marking this as 'security: No encryption'
From what I understand I need to use TLS to create a 'secure' connection. I already have a certificate and keys from LetsEncrypt and my domain is already using HTTPS. How do I encrypt/use TLS my outgoing emails?
Or is there a better package for this? I've tried using NodeMailer and my emails only get added to a 'queue' and never sent.
ssl smtp lets-encrypt nodemailer starttls
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to be able to send emails from my local domain without using gmail or other SMTP servers.
I'm currently using SendMail:
const sendmail = require('sendmail') ({
logger: {
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error
},
dkim: {
privateKey: dkimPrivateKey,
keySelector: 'default'
},
});
sendmail({
from: 'foo@mydomain.com',
to: 'mygmail@gmail.com',
subject: 'test sendmail',
html: 'Mail of test sendmail ',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
and this DOES work, BUT when I receive the email in my Gmail account, and I view the message information, Google is marking this as 'security: No encryption'
From what I understand I need to use TLS to create a 'secure' connection. I already have a certificate and keys from LetsEncrypt and my domain is already using HTTPS. How do I encrypt/use TLS my outgoing emails?
Or is there a better package for this? I've tried using NodeMailer and my emails only get added to a 'queue' and never sent.
ssl smtp lets-encrypt nodemailer starttls
I want to be able to send emails from my local domain without using gmail or other SMTP servers.
I'm currently using SendMail:
const sendmail = require('sendmail') ({
logger: {
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error
},
dkim: {
privateKey: dkimPrivateKey,
keySelector: 'default'
},
});
sendmail({
from: 'foo@mydomain.com',
to: 'mygmail@gmail.com',
subject: 'test sendmail',
html: 'Mail of test sendmail ',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
and this DOES work, BUT when I receive the email in my Gmail account, and I view the message information, Google is marking this as 'security: No encryption'
From what I understand I need to use TLS to create a 'secure' connection. I already have a certificate and keys from LetsEncrypt and my domain is already using HTTPS. How do I encrypt/use TLS my outgoing emails?
Or is there a better package for this? I've tried using NodeMailer and my emails only get added to a 'queue' and never sent.
ssl smtp lets-encrypt nodemailer starttls
ssl smtp lets-encrypt nodemailer starttls
edited Nov 21 at 6:17
asked Nov 19 at 12:55
orangeMint
451323
451323
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The TLS encryption doesn't have to do anything with the HTTP certificates. This works with STARTTLS. Did you found any reason for queuing in the maillog? Hope the ports are not blocked.
You can try out this Node library: https://github.com/pepipost/pepipost-sdk-nodejs
It does TLS encryption and works over HTTP instead of SMTP.
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The TLS encryption doesn't have to do anything with the HTTP certificates. This works with STARTTLS. Did you found any reason for queuing in the maillog? Hope the ports are not blocked.
You can try out this Node library: https://github.com/pepipost/pepipost-sdk-nodejs
It does TLS encryption and works over HTTP instead of SMTP.
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
add a comment |
up vote
0
down vote
The TLS encryption doesn't have to do anything with the HTTP certificates. This works with STARTTLS. Did you found any reason for queuing in the maillog? Hope the ports are not blocked.
You can try out this Node library: https://github.com/pepipost/pepipost-sdk-nodejs
It does TLS encryption and works over HTTP instead of SMTP.
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
add a comment |
up vote
0
down vote
up vote
0
down vote
The TLS encryption doesn't have to do anything with the HTTP certificates. This works with STARTTLS. Did you found any reason for queuing in the maillog? Hope the ports are not blocked.
You can try out this Node library: https://github.com/pepipost/pepipost-sdk-nodejs
It does TLS encryption and works over HTTP instead of SMTP.
The TLS encryption doesn't have to do anything with the HTTP certificates. This works with STARTTLS. Did you found any reason for queuing in the maillog? Hope the ports are not blocked.
You can try out this Node library: https://github.com/pepipost/pepipost-sdk-nodejs
It does TLS encryption and works over HTTP instead of SMTP.
answered Nov 19 at 13:07
Dibya Sahoo
389514
389514
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
add a comment |
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Never found why the email was being held in the queue, it wasn't the port. I'll check the link you sent, however, I'd like to stay with free/MIT license packages
– orangeMint
Nov 19 at 13:13
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Nodemailer is definitely a good one. If you can share the /var/log/mail.log output, that will help to further debug what can be the possible root cause for the queuing.
– Dibya Sahoo
Nov 19 at 13:27
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
Didn't find anything in that log file... but here is more info on my NodeMailer set up that I just posted stackoverflow.com/questions/53376807/…
– orangeMint
Nov 19 at 14:33
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375124%2fhow-to-send-encrypted-tls-emails-with-nodejs-from-localhost-using-send-mail%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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