gmailer
v0.0.1
Published
Simple API to send messages from GMAIL
Downloads
6
Maintainers
Readme
gmailer
A module that exposes sending mail using gmail
This module has been tested under limited scenarios. If you find any issues, please feel free to report them.
Install
npm install gmailer
API
var send = require('gmailer');
send(
oauthRefreshToken,
{
// from is optional. it is only useful if you want to use a
// name than the one associated with the account etc.
from: '"Some User" <[email protected]>",
// to is an array of email addresses
to: [ '[email protected]'],
// you can pass any extra headers via headers
headers: {
Subject: 'Standard header',
'Message-ID': "Some Unique ID yo"
},
// content-type is option and defaults to text/plain
contentType: 'text/html;chartset=utf8',
// actual message body comes via body.
body: "<html><div>Some piece of text</div></html>"
},
function (err, ret) {
//ret.messageId and ret.threadId may be useful.
}
);
Other considerations
There is no support for multi-part MIME or attachments. You are welcome to send patches for those!