Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mailx
Advanced tools
Readme
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 51 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.