mime-message
v0.1.3
Published
Simple node module to create mime type messages easily and safety!
Downloads
126
Maintainers
Readme
Mime-message
Simple node module to create mime types messages easily and safety!
Hi guys! I decided to create this module because I'm working with emails and I did not found any node module to easily create mime messages in the javascript ecosystem. I decided to release it because I'm sure more people has this problem! :).
Api methods
- validMimeMessage(data)
- createMimeMessage(data)
- toBase64SafeString()
How to use it?
const mimeMessage = require('./lib/MimeMessage')
const messageData = {
type: 'text/html',
encoding: 'UTF-8',
from: 'Jorge <[email protected]>',
to: [
'User 1 <[email protected]>',
'User 2 <[email protected]>'
],
cc: [
'User 3 <[email protected]>'
],
bcc: [],
replyTo: [
'Jorge <[email protected]>',
],
date: new Date(),
subject: 'Hello World!',
body: '<h1>Hello from the other side!</h1><p>This is pretty awesome!</p>'
}
if (Mime.validMimeMessage(messageData)) {
const message = Mime.createMimeMessage(messageData)
const base64SafeString = message.toBase64SafeString()
console.log(base64SafeString)
}
No more documentation by now. Sorry guys, I'm quite busy right now ><.