Skip to content

Like-Falling-Leaves/gmailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmailer

A module that exposes sending mail using gmail

NPM info

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: [ 'someone@exapmple.com'],
       // 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!

About

Simple API to send mails from gmail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published