New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@mailchain/message-composer

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mailchain/message-composer

Mailchain MIME message composer. RFC-5322 compliant

latest
Source
npmnpm
Version
0.31.0
Version published
Weekly downloads
1.6K
-20.36%
Maintainers
2
Weekly downloads
 
Created
Source

Mailchain Message Composer

Warning @mailchain/message-composer library is in development and may not cover all cases yet. Use with caution.

RFC-5322 compliant MIME message composer for Node and for the browser. Just add the content you want and let the library take care of formatting it according to the specification.

Usage

const msg = createMessageComposer(messageComposerContext)
	// .id('47bdaf40-c3da-49f7-bfc7-66337f35c6c1@mailchain.com') // Optional
	.subject('Subject can contain UTF-8 chars including emojis 😉')
	// .date(new Date('08/28/2022')) // Optional
	.from({ name: 'Bob', address: 'bob@mailchain.com' })
	.recipients('To', { name: 'Alice', address: 'alice@mailchain.com' })
	.recipients('Cc', { name: 'Joe Doe', address: 'joe@mailchain.com' })
	.recipients(
		'Bcc',
		{ name: 'Jane Doe', address: 'jane@mailchain.com' },
		{ name: 'Bob', address: 'bob@mailchain.com' },
	)
	.message('plain', Buffer.from('Plaintext content. Can also contain UTF-8 and emojis 🤐.'))
	.message('html', Buffer.from('This is ✨rich-text✨ HTML <b>content</b>.'))
	.attachment({
		cid: 'bfcd3a31-646b-4dcd-a1ea-06d37baf7d2e',
		contentType: 'image/png',
		filename: 'mailchain-logo.png',
		content: readFileSync('mailchain-logo.png'),
	});

const { forSender, forVisibleRecipients, forBlindedRecipients } = await msg.build();

For full usage examples view the developer docs.

Installing

Using npm:

$ npm install @mailchain/message-composer

Using yarn:

$ yarn add @mailchain/message-composer

FAQs

Package last updated on 16 Nov 2023

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