gmail-api
v1.1.1
Published
> Interact with the Gmail API
Readme
Gmailer
Interact with the Gmail API
API
sendMail(options)
options: <Object>
All options are required
| Option | Type | Description |
| :-------- | :-------------------------- | :-------------------------------- |
| from | String | Senders email address |
| to | String, List or Array | Who to send the email to. |
| subject | String | Subject of the email |
| body | String | Body of the email. Accepts html |
Example:
const { sendMail } = require('gmail-api');
sendMail({
from: '"John Doe" <[email protected]>',
// <Array> Sends an individual email to each person.
// <List> Sends one email to all recipients
// (e. g. '[email protected], [email protected]')
// <String> Send one email to the recipient
// (e. g. '[email protected]')
to: ['[email protected]', '[email protected]'],
subject: 'Node.js Email',
// `file(url)` Sends the contents of the file url
body: file('../email.html'),
});file(url)
url: <String> or <Url>
Sends the contents of the url.
// Accepts absolute and relative paths
file('https://example.com/myfile.html');
file('../myfile.js');Full docs avaliable at Docs
