Socket
Book a DemoInstallSign in
Socket

cloudmailin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudmailin

Official Node.js for the CloudMailin Email API - https://www.cloudmailin.com

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
805
-14.9%
Maintainers
1
Weekly downloads
 
Created
Source
CloudMailin Logo

CloudMailin Node.js Library

A Node.JS SDK for CloudMailin written in Typescript for receiving incoming email via JSON HTTP POST.

Please see the Documentation for more details and examples.

Usage

You can install the library using NPM.

npm install cloudmailin

Receiving Email

We recommend you take a look at our Documentation for a more detailed example but here's a snippet:

import express from "express";
import bodyParser from "body-parser";
import { IncomingMail } from "cloudmailin";

const app = express();
app.use(bodyParser.json());

app.post("/incoming_mails/", (req, res) => {
  const mail = <IncomingMail>req.body;

  res.status(201).json(mail);
}

Sending Email

import { MessageClient } from "cloudmailin"

const client = new MessageClient({ username: USERNAME, apiKey: API_KEY});
const response = await client.sendMessage({
  to: 'test@example.net',
  from: 'test@example.com',
  plain: 'test message',
  html:  '<h1>Test Message</h1>',
  subject: "hello world"
});

Development

Generating the OpenAPI reference:

npx openapi-typescript ./path_to/api.yaml --output ./src/models/cloudmailin-api.ts

Keywords

cloudmailin

FAQs

Package last updated on 23 Jan 2024

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.