Socket
Socket
Sign inDemoInstall

mailjet-sendemail

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mailjet-sendemail

Sends email using Mailjet API via Node.js


Version published
Weekly downloads
56
increased by16.67%
Maintainers
1
Install size
5.36 kB
Created
Weekly downloads
 

Readme

Source

mailjet-sendemail

This library permits to send emails using Mailjet's API in Node.js. It's MIT licensed.

Installation

npm install mailjet-sendemail

Initialization

Access to the API is done through a Mailjet object. It's instantiated like so:

var Mailjet = require('mailjet-sendemail');
var mailjet = new Mailjet('apiKey', 'secretKey');

Sending Email

sendContent

Sends an email.

mailjet.sendContent(from, to, subject, type, content);
  • from - Sender of the message; this should be a full email address (e.g. example@example.com).
  • to - A string (example@example.com) or array of strings (['a@example.com', 'b@example.com']) of recipients. For cc and bcc support, append cc: or bcc: to the recipient email address (cc:example@example.com).
  • subject - Message subject
  • type - The type of the email, 'text' or 'html'
  • content - Message content, depending on the type

Examples

With plain text :

mailjet.sendContent('sender@example.com',
         ['recipient1@example.com', 'bcc:recipient2@example.com'],
         'This is a test !',
         'text',
         'Well, this is working !')

With HTML :

mailjet.sendContent('sender@example.com',
         ['recipient1@example.com', 'bcc:recipient2@example.com'],
         'This is a test !',
         'html',
         '<b>Well, this is working !</b>')

FAQs

Last updated on 13 Jan 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc