I'm able to send email with any email address without password in a Linux machine using sendmail. Is there any option like this to do it programmatically using node.js in windows?
Sending mail without authentication using nodejs
Use NodeMailer. This will give you two options:
You can remove
auth
from the example code when creating a SMTP Transport message if you have local IIS SMTP turned on. Obviously, sethost: 'localhost'
and the other settings to match your SMTP.Alternatively, you might be able to make use of sendmail-transport with some third party software such as Sendmail for Windows . SMW emulates the unix method. Unfortunately, SMW is no longer maintained.
this answer seems to be making some assumptions that Window is involved in some way (IIS, Sendmail for Windows). Can you address how to proceed if this is not the case? –
Hoxha
@Hoxha you clearly failed to read the question in which a windows solution is specifically asked for. –
Shapely
@Shapely Ah, so I did... oops –
Hoxha
I would recommend take a look at the sendmail library which does not need any smtp/auth to send email. It gives you similar experience to using sendmail
in linux server.
const sendmail = require('sendmail')();
sendmail({
from: '[email protected]',
to: '[email protected]',
subject: 'Hello World',
html: 'Mail of test sendmail '
}, function (err, reply) {
console.log(err && err.stack)
console.dir(reply)
})
© 2022 - 2024 — McMap. All rights reserved.
nodemailer-sendmail-transport
module. – Transitive