
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
mailx is a simple and complete email client library (pop, imap and smtp) for nodejs.
the message object is used to write or read a message.
Sample: write a new message
var message = mailx.message();
message.setFrom('me', 'me@example.net');
message.addTo('you', 'you@example.net');
message.setSubject('hello');
message.setText('hi ! how are u?');
message.setHtml('hi ! how are u? <b>hugs</b>');
the transport objet is used to send a predefined message.
Sample: sending a message
var transport = mailx.transport('smtp.example.net', 25, 'login', 'password');
transport.send(message, function(err,result) {
console.log(result);
});
Store object
Sample: get all messages from server, log their subjets and delete the last one
var store = mailx.store('pop3', 'pop.example.net', 110, 'login', 'password');
store.connect(function(err) {
if (err) {
return console.log('connect error', err);
}
store.getInboxMessages(0, function(err, messages) {
if (err) {
return console.log('inbox error', err);
}
messages.forEach(function(message,index) {
console.log(message.subject);
if (index === messages.length - 1) {
message.delete(function(err, data) {
console.log('message deleted!', data);
store.close(function(err, data) {
console.log('store.close err:', err);
});
});
}
});
});
});
Sample: get message by message from server and log their subjets
var store = mailx.store('imap', 'imap.example.net', 143, 'login', 'password');
store.connect(function(err) {
if (err) {
return console.log('err connect: ', err);
}
var inbox = store.getInbox(1);
inbox.fail(function(err){
console.log('fail get messages: ', err);
});
inbox.done(function(status){
console.log('end of inbox');
});
(function recursiveRcpt() {
inbox.getNextMessage(function(err, message) {
if (err) {
return console.log('fail get message: ', err);
}
if (message === null) {
return console.log('no more message to read');
}
console.log(message.subject);
recursiveRcpt();
});
})();
});
FAQs
simple and complete email client library (pop, imap and smtp) for nodejs
The npm package mailx receives a total of 88 weekly downloads. As such, mailx popularity was classified as not popular.
We found that mailx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.