Gathering detailed insights and metrics for feathers-mailer
Gathering detailed insights and metrics for feathers-mailer
Gathering detailed insights and metrics for feathers-mailer
Gathering detailed insights and metrics for feathers-mailer
@stoplight/feathers-mailer
Feathers mailer service
@sparkz-community/messenger-server-lib
[](https://travis-ci.org/feathersjs/ir-mailer-server) [](https://codeclimate.com/
feathers-sendwithus
Feathers service for sending mailers with sendwithus.com.
feathers-sendwithus-batch
Feathers service for sending mailers with sendwithus.com.
npm install feathers-mailer
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (91.13%)
JavaScript (8.87%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
82 Stars
64 Commits
16 Forks
5 Watchers
1 Branches
17 Contributors
Updated on Jun 20, 2025
Latest Version
4.2.0
Package Id
feathers-mailer@4.2.0
Unpacked Size
26.24 kB
Size
7.67 kB
File Count
18
NPM Version
10.8.1
Node Version
20.8.0
Published on
Jan 03, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Feathers mailer service using
nodemailer
1npm install feathers-mailer --save
If using a transport plugin, install the respective module.
1import { Service } = from 'feathers-mailer'; 2 3app.use('/emails', new Service(transport, defaults));
transport
can be either SMTP options or a transport plugin with associated options.defaults
is an object that defines default values for mail options.service.create(body, params)
service.create
is a thin wrapper for transporter.sendMail
, accepting body
and returning a promise.
See here for possible fields of body
.
1import { Service } from "feathers-mailer"; 2import nodemailer from "nodemailer"; 3 4(async function (app) { 5 const account = await nodemailer.createTestAccount(); // internet required 6 7 const transporter = { 8 host: account.smtp.host, 9 port: account.smtp.port, 10 secure: account.smtp.secure, // 487 only 11 requireTLS: true, 12 auth: { 13 user: account.user, // generated ethereal user 14 pass: account.pass, // generated ethereal password 15 }, 16 }; 17 18 // Register service and setting default From Email 19 app.use("mailer", new Service(transporter, { from: account.user })); 20 21 // Use the service 22 const email = { 23 to: "president@mars.com", 24 subject: "SMTP test", 25 html: "This is the email body", 26 }; 27 28 await app.service("mailer").create(email); 29 console.log(`Preview URL: ${nodemailer.getTestMessageUrl(info)}`); 30})(app);
1import { Service } from "feathers-mailer"; 2import mandrill from "nodemailer-mandrill-transport"; 3 4// Register the service, see below for an example 5app.use( 6 "/mailer", 7 new Service( 8 mandrill({ 9 auth: { 10 apiKey: process.env.MANDRILL_API_KEY, 11 }, 12 }) 13 ) 14); 15 16// Use the service 17const email = { 18 from: "FROM_EMAIL", 19 to: "TO_EMAIL", 20 subject: "Mandrill test", 21 html: "This is the email body", 22}; 23 24app 25 .service("mailer") 26 .create(email) 27 .then(function (result) { 28 console.log("Sent email", result); 29 }) 30 .catch((err) => { 31 console.log(err); 32 });
A more and more appearing 'issue' these days, is that mail sent can be seen as spam. Especially if the 'from address' is not linked to the IP of the sending host. To prevent this, you can use a DKIM record. It does require a DNS mutation on the domain reflecting the 'from address', but it will prevent this. Following these steps you can implement this in node-mailer
from address
domain), and something to use as a selector e.g. feathersMailer
.email
constance defined in the example above, so it becomes like this1 const email = { 2 to: 'president@mars.com', 3 subject: 'SMTP test', 4 html: 'This is the email body', 5 domainName: 'THE DOMAIN ENTERED FOR THE RECORD (FROM ADDRESS DOMAIN)', 6 keySelector: 'THE SELECTOR YOU ENTERED TO GENERATE THE RECORD', 7 privateKey: 'THE CONTENT FROM THE `PRIVATE KEY` BUT REPLACE `linebreaks` WITH `\n`' 8 };
Important: You must replace the linebreaks
of the private key with \n
or it won't work.
A use case for this, could be a multitenancy application. There the reply domains would be different, but you might want to send from the local SMTP server of the ISP. You would then make it possible for each tenant to configure the three values in their tenant settings within the application, and dynamically collect it prior to sending the mail.
Copyright (c) 2025
Licensed under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
7 existing vulnerabilities detected
Details
Reason
Found 6/24 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More