Awesome
puppeteer-email
Email automation driven by headless chrome.
Features
- automate email account creation
- automate email sending
- automate email fetching
- automate email verification from third-party services
- github
- etc.
- comes with a library and CLI
- uses puppeteer under the hood
- perfect for bots...
Status
This project is an early WIP, but the CLI currently works to automate Outlook.
Packages
- puppeteer-email - Main library entrypoint.
- puppeteer-email-cli - CLI for executing one-off email automation tasks.
- puppeteer-email-session - Holds state for an authenticated puppeteer email session.
- puppeteer-email-provider - Abstract base class for puppeteer email providers.
- puppeteer-email-provider-outlook - Puppeteer email provider for Outlook.
- puppeteer-email-provider-gmail - Puppeteer email provider for Gmail. (TODO)
- puppeteer-email-provider-yahoo - Puppeteer email provider for Yahoo Mail. (TODO)
- parse-email - Parses mime-encoded email messages.
- sms-number-verifier - Allows you to spoof SMS number verification.
Usage
CLI
npm install -g puppeteer-email-cli
Usage: puppeteer-email [options] [command]
Options:
-V, --version output the version number
-u, --username <username> email account username
-p, --password <password> email account password
-P, --provider <provider> email provider (default: outlook)
-H, --no-headless (puppeteer) disable headless mode
-s, --slow-mo <timeout> (puppeteer) slows down operations by the given ms (default: 0)
-h, --help output usage information
Commands:
signup [options]
signin
get-emails [options]
See the CLI for more in-depth CLI docs.
Library
This example signs into an Outlook account, searches for a given query, and then parses and returns all emails returned for that query.
npm install --save puppeteer-email
const PuppeteerEmail = require('puppeteer-email')
const client = new PuppeteerEmail('outlook')
const username = 'XXX'
const password = 'XXX'
const session = await client.signin({ username, password })
const emails = await session.getEmails({ query: 'from:github' })
await session.close()
console.log(emails)
Example parsed email output:
[
{
"attachments": [ /* ... */ ],
"headers": { /* ... */ },
"html": "<!DOCTYPE html>\n<html>...</html>",
"text": "...",
"textAsHtml": "<p>...</p>",
"subject": "Example email subject",
"date": "2018-05-09T14:17:02.000Z",
"to": {
"value": [
{
"address": "fischxxxx@outlook.com",
"name": "Travis Fischer"
}
],
"html": "<span class=\"mp_address_name\">Travis Fischer</span> <<a href=\"mailto:fischxxxx@outlook.com\" class=\"mp_address_email\">fischxxxx@outlook.com</a>>",
"text": "Travis Fischer <fischxxxx@outlook.com>"
},
"from": {
"value": [
{
"address": "noreply@github.com",
"name": "GitHub"
}
],
"html": "<span class=\"mp_address_name\">GitHub</span> <<a href=\"mailto:noreply@github.com\" class=\"mp_address_email\">noreply@github.com</a>>",
"text": "GitHub <noreply@github.com>"
},
"messageId": "<01.B3.11399.xxxxxxxx@momentum1-mta1>"
}
]
See the library for more in-depth library docs.
See parse-email for details on email model properties.
Related
- puppeteer - Headless Chrome Node API used under the hood.
- parse-email - Parses mime-encoded email messages.
- sms-number-verifier - Allows you to spoof SMS number verification.
- puppeteer-github - GitHub automation driven by headless chrome.
- awesome-puppeteer - A curated list of awesome puppeteer resources.
Disclaimer
Using this software to violate the terms and conditions of any third-party service is strictly against the intent of this software. By using this software, you are acknowledging this fact and absolving the author or any potential liability or wrongdoing it may cause. This software is meant for testing and experimental purposes only, so please act responsibly.
License
MIT © Travis Fischer
Support my OSS work by <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a>