
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
sendgrid-mail
Advanced tools
Main repo: https://github.com/huned/nodejs-sendgrid-mail
This is the simplest way to send mail with sendgrid in node.js.
Features:
mail style interface and sensible defaultsnpm install sendgrid-mail
sgSendmail = require('sendgrid-mail')
sgSendmail({
// Required SendGrid API key
apikey: 'your sendgrid api key',
// Optional to/cc/bcc fields.
// Specify at least one email address in any of these fields.
to: ['John Doe <john.doe@example.com>'],
cc: [],
bcc: [],
// Optional from/replyTo fields.
// The from address must be a verified sender in your SendGrid account.
from: 'Jane Doe <jane.doe@example.com>',
replyTo: 'noreply@example.com',
// Optional subject of the email
subject: 'test subject',
// Optional body of the email
body: 'plain text body',
// Optional content type of email body.
contentType: 'text/html',
// Optionally avoid sending empty emails
suppressEmpty: true,
})
$ echo 'hello, world.' | sendgrid-mail -k <sendgrid api key> -s 'Test Subject' --from=sender@example.com recipient@example.com
You can specify options (see sendgrid-mail --help for more details)
-E
--suppressEmpty
OPTIONAL
Do not send messages with an empty body.
-s <subject>
--subject=<subject>
OPTIONAL
Specify subject on command line. (Only the first argument after the
-s flag is used as a subject; be careful to quote subjects containing
spaces.)
-c <cc-addr>
--cc=<cc-addr>
OPTIONAL
Send carbon copies to cc-addr list of users. The cc-addr argument
should be a comma-separated list of email addresses.
-b <bcc-addr>
--bcc=<bcc-addr>
OPTIONAL
Send blind carbon copies to bcc-addr list of users. The bcc-addr
argument should be a comma-separated list of email addresses.
The following options are specific to this program and used when calling
SendGrid's API v3 /mail/send endpoint.
-k <api key>
--key=<api key>
REQUIRED
Set a SendGrid API key. Can also be set by defining SENDGRID_API_KEY.
--from=<from-addr>
REQUIRED
Set the from-addr for outgoing messages. Can also be set by defining
SENDGRID_MAIL_FROM.
**IMPORTANT** from-addr must be a verified sender for your SendGrid
account.
--replyTo=<replyto-addr>
OPTIONAL
Set the reply-to field for outgoing messages. Can also be set by
defining SENDGRID_MAIL_REPLYTO. If unset, defaults to $REPLYTO.
--html
OPTIONAL
Indicate that mail body content type is "text/html". If unset, mail
content type is "text/plain".
MIT
FAQs
The easiest way to send mail with sendgrid.
The npm package sendgrid-mail receives a total of 282 weekly downloads. As such, sendgrid-mail popularity was classified as not popular.
We found that sendgrid-mail 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.