Giter VIP home page Giter VIP logo

puppeteer-email's Introduction

puppeteer-email

Email automation driven by headless chrome.

NPM Build Status JavaScript Style Guide

Features

  • automate email account creation
  • automate email sending
  • automate email fetching
  • automate email verification from third-party services
    • twitter
    • github
    • facebook
    • 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

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": "[email protected]",
          "name": "Travis Fischer"
        }
      ],
      "html": "<span class=\"mp_address_name\">Travis Fischer</span> &lt;<a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a>&gt;",
      "text": "Travis Fischer <[email protected]>"
    },
    "from": {
      "value": [
        {
          "address": "[email protected]",
          "name": "GitHub"
        }
      ],
      "html": "<span class=\"mp_address_name\">GitHub</span> &lt;<a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a>&gt;",
      "text": "GitHub <[email protected]>"
    },
    "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

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 following me on twitter twitter

puppeteer-email's People

Contributors

andretunes avatar transitive-bullshit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppeteer-email's Issues

GMAIL - Unable to open the latest email and click on one of the link

Hi,

I am trying to open the latest email in Gmail and click on one of the click. But I am unable to.
Here are steps using Puppeteer ,

  1. Login into GMAIL, ---- Successful
    2.Search for the "Unread email with the text"- Successful
  2. Now using xPath trying to click on the latest email but failing,
    Below is the code
    await page.waitForXPath('//[@Class="zA zE"]');
    const [emails] = await page.$x('//
    [@Class="zA zE"]');
    if(emails)
    {
    await Promise.all([
    await page.waitForNavigation(),
    emails.click()
    ])
    }
    it says TypeError: Cannot read property 'click' of undefined

Could anyone please help me with this.

provider: Web.de / Yandex.ru

why dont add both email provider to the email script =) would be a great improvement to have more email services available.

~greetings

use custom user-agent

Possibly:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116

THE PUPPETEER OUTLOOK NOT WORK.

Hello, I downloaded the package I installed it as written in the manual, I entered a username and password and it does not work.
Can you explain exactly how to run it? Maybe a YouTube video? I was looking for how to activate it and I can not and can not get information about it on the net as if the explanations you wrote here are not enough because it does not work and I owe this thing can you help me please? Thank you very much

TimeoutError exception is a very common issue

Hey,

This is quite an interesting library although it has it's fair share of timeout issues.

TimeoutError: waiting for selector "input[type=checkbox]" failed: timeout 30000ms exceeded

This exception appears the majority of the time when signing in, it's unknown why.

not working

with input puppeteer-email signup -u "test" -p "test" -P "outlook"
I get

{ ArgumentError: Expected username to be of type string but received type undefined
at new GetSMSCodeClient (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/getsmscode/index.js:51:5)
at new GetSMSCodeOTPProvider (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/sms-number-verifier/lib/provider-getsmscode.js:16:20)
at Object.exports.getProviderByName (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/sms-number-verifier/lib/providers.js:16:10)
at new SMSNumberVerifier (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/sms-number-verifier/index.js:22:19)
at Command.program.command.option.option.option.option.action (/usr/local/lib/node_modules/puppeteer-email-cli/lib/cli.js:41:13)
at Command.listener (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/commander/index.js:315:8)
at emitTwo (events.js:126:13)
at Command.emit (events.js:214:7)
at Command.parseArgs (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/commander/index.js:651:12)
at Command.parse (/usr/local/lib/node_modules/puppeteer-email-cli/node_modules/commander/index.js:474:21) name: 'ArgumentError' }

provider: gmail

  • signin
  • signup
  • signout
  • sendEmail
  • getEmails
  • docs
  • unit tests
  • integration tests

provider: outlook

  • signin
  • signup
  • signout
  • sendEmail
  • getEmails
  • docs
  • unit tests
  • integration tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.