Giter Club home page Giter Club logo

easy-yopmail's Introduction

๐Ÿ“ฎ Easy-YOPMail v5.0

easy-yopmail

npm Documentation NPM Unpacked Size
SonarCloud

---

๐Ÿ’Œ Introducing Easy-YOPmail v5.0: Effortless Temporary Email Management for Node.js

Easy-YOPmail is a powerful Node.js library designed to simplify the way you interact with temporary email addresses from the YOPmail service. This version brings enhanced functionality, improved performance, and an even more intuitive developer experience.

Easy-YOPmail v5.0 empowers you to:

  • Generate Random Emails: Create unique and disposable email addresses instantly.
  • Manage Inboxes: Access, read, and delete emails from any YOPmail inbox.
  • Target Specific Content: Extract data from emails using CSS selectors and attributes.
  • Automate Workflows: Effortlessly integrate temporary email management into your scripts and applications.

Why Choose Easy-YOPmail?

  • Simplicity: Intuitive API for seamless integration into your Node.js projects.
  • Efficiency: Asynchronous operations for fast and responsive email handling.
  • Flexibility: Customize email retrieval and content extraction with powerful options.
  • Reliability: Built on the robust YOPmail platform, ensuring consistent performance.

๐Ÿš€ Getting Started

  1. Install Easy-YOPmail:

    npm i easy-yopmail
  2. Import the library:

    const easyYopmail = require('easy-yopmail');
  3. Explore the examples below and the full documentation to harness the power of Easy-YOPmail!

๐Ÿ’ก Common Use Cases

  • Automated Testing: Create temporary email addresses for testing user registration, password resets, and other email-dependent features.
  • Web Scraping: Bypass email verification requirements on websites and collect data efficiently.
  • Anonymous Sign-Ups: Sign up for services without revealing your primary email address.
  • Notification Systems: Send automated notifications or alerts using disposable YOPmail addresses.

โœ‰๏ธ Example: Generating a Temporary Email

easyYopmail.getMail().then(email => {
    console.log(email); 
    // Output: [randomly generated name]@yopmail.com 
});

๐Ÿ—ƒ๏ธ Example: Reading the inbox of an email

easyYOPmail.getInbox('testing_01').then(inbox => {
    console.log(inbox);
    //Output:
    //{
    //  settings: {},
    //  search: {},
    //  totalInbox: 271,
    //  totalPages: 19,
    //  mailFromPage: { page_1: 15 },
    //  totalGetMails: 15,
    //  inbox: [
    //       {
    //         id: 'e_ZwZjAGVlZGHlZQR1ZQNjAwZ5AQp4ZD==',
    //         from: 'Ola no-reply',
    //         subject: 'this is example message...',
    //         timestamp: '10:20'
    //       }
    //  ]
    //}
});

๐Ÿ“‘ Example: Read a message

easyYOPmail.readMessage('testing_01', 'e_ZwZjAGVlZGHlZQR1ZQNjAwZ5AQp4ZD==', 'TXT').then(message => {
    console.log(message);
    //Output:
    //{
    //  id: 'e_ZwZjAGVlZGHlZQR1ZQNjAwZ5AQp4ZD==',
    //  submit: 'ITechnoLabs Notification - Event from Hanwha  XNV-6012',
    //  from: 'ITechnoLabs Notification Service <[email protected]>',
    //  date: 'Monday, May 22, 2023 10:23:26 PM',
    //  selector: '#mail',
    //  format: 'txt',
    //  data: 'Hanwha  XNV-6012\n ...'
    //}
});

๐Ÿ’– Supporting Easy-YOPMail

We deeply appreciate your interest in supporting Easy-YOPmail! Your sponsorship helps us maintain and enhance the library, bringing valuable features and improvements to the community.

Here are a few ways you can contribute:

1. Financial Support:

2. Show Your Love on GitHub:

Every contribution, big or small, helps us immensely. We are incredibly grateful for your support!

easy-yopmail's People

Contributors

jasp402 avatar

Stargazers

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

Watchers

 avatar  avatar

easy-yopmail's Issues

cant connect server 199.59.149.236:443

Error: connect ETIMEDOUT 199.59.149.236:443
getMail(): Error getting YOPMail page
connect ETIMEDOUT 199.59.149.236:443
node:internal/process/promises:279

Having issues reading the subject

hey, i was trying to read messages from my mail, but everything is empty,

{
id: 'e_ZwDjAGVkZGVlAwHmZQNjAGR4ZwH1Zj==',
submit: '',
from: '',
date: '',
selector: '#mail',
format: 'TXT',
data: ''
}

{
settings: {},
search: {},
totalInbox: 1,
totalPages: 1,
mailFromPage: { page_1: 1 },
totalGetMails: 1,
inbox: [
{
id: 'e_ZwDjAGVkZGVlAwHmZQNjAGR4ZwH1Zj==',
from: 'Instagram',
subject: '****** is your Instagram code',
timestamp: '18:26'
}
]
}

getInbox(): Error getting Inbox page for simple call

๐Ÿ› Issue Report

Title: [Short and descriptive title]

Labels: bug

Environment:

  • Operating system: ๐Ÿ’ป Ubuntu
  • Version of NodeJS: ๐ŸŒ 20.2.0
  • Version of Easy-yopmail: ๐Ÿ“ฆ ^4.0.17

Steps to Reproduce:

  1. โžก๏ธ [Step 1]
    This code is sufficient to reproduce:
const easyYOPmail = require('easy-yopmail');

easyYOPmail.getInbox('[email protected]').then(inbox => {
    console.log(inbox);
})

The email exists, it was created with the current API.


๐Ÿณ๏ธ Expected Behavior:
inbox gets fetched

๐Ÿšฉ Actual Behavior:
Error:

getInbox(): Error getting Inbox page

Request failed with status code 403

Can't npm install

๐Ÿ› Issue Report

Title: Can't npm install

Labels: bug

Environment:

  • Operating system: ๐Ÿ’ป Windows 11
  • Version of NodeJS: ๐ŸŒ 20.10.0
  • Version of Easy-yopmail: ๐Ÿ“ฆ 4.0.23

Steps to Reproduce:

  1. โžก๏ธ Create a new folder
  2. โžก๏ธ npm init -y
  3. โžก๏ธ npm i easy-yopmail

๐Ÿณ๏ธ Expected Behavior:

Library installed

๐Ÿšฉ Actual Behavior:

npm ERR! errno -4058

๐Ÿ“ท Screenshots / Live demo link:

image

๐Ÿงฎ Additional Context:

None


๐Ÿค” I expected npm to successfully install the library, but instead it failed with errno -4058.

Yopmail- Sender object info is shown in Subject and Subject info shown in content , no way to access mail body

image

Sample Snippet

// const constants = require('../constants/constants.app');
const easyYopmail = require('easy-yopmail');
// const assert = require('assert');
// const fs = require('fs');

const k= async function(){
const inbox = await easyYopmail.getInbox("[email protected]", {}, {MAX_PAGE:1});
//Below code is not working
// const inbox1 = await easyYopmail.readMessage("[email protected]");
await console.log(JSON.stringify(inbox))
// await console.log(JSON.stringify(inbox1))
// await console.log(inbox1)
// await console.log(inbox1)
}

k();

Attached files in read message

Hello,

It seems to me that the readMessage function does not return attached files. it would be nice to be able to get thoses as well.
The link of the attached file is present on the mail and then be able to download it.

Error getting total number of mails

๐Ÿ› Issue Report

Title: Error getting total number of mails

Labels: bug

Environment:

  • Operating system: ๐Ÿ’ป Macos
  • Version of NodeJS: ๐ŸŒ16.15.1
  • Version of Easy-yopmail: ๐Ÿ“ฆ 4.0.19

Steps to Reproduce:

  1. โžก๏ธ [Step 1]
    When run this code in js: easyYOPmail.getInbox('mailname');

๐Ÿณ๏ธ Expected Behavior:
Return inbox array

๐Ÿšฉ Actual Behavior:
Found error message: Error getting total number of mails


๐Ÿ’ฌ Please let me know if you have any questions.

Trying to Use The readMessage Function But it doesn't work fine

readMessage(): Error read message
Request failed with status code 400
Error reading message: Error: AxiosError: Request failed with status code 400
at Object.readMessage (C:\Users\xx\node_modules\easy-yopmail\dist\index.js:1:2504)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {stack: 'Error: AxiosError: Request failed with statusโ€ฆions (node:internal/process/task_queues:95:5)', message: 'AxiosError: Request failed with status code 400'}

https://runkit.com/embed/jx1qgfuqcepk

readMessage(): Error read message

readMessage(): Error read message
Cannot read properties of undefined (reading 'toLowerCase')
D:\Coding\JS\Projects\InstaBotnet\node_modules\easy-yopmail\index.js:1
"use strict";const cheerio=require("cheerio"),querystring=require("querystring"),constants=require("./src/constants.js"),utils=require("./src/utils.js");class EasyYopmail{async getMail(){try{const a=await utils.request("GET",constants.GENERATOR_URL);if(200!==a.statusCode)return console.error(constants.ERROR_LOAD_PAGE),null;const b=cheerio.load(a.body),c=b(constants.S_INPUT_MAIL_GENERATE).text();return c.split(";")[1]||c}catch(a){throw console.error(constants.ERROR_LOAD_PAGE),console.error(a.message),new Error(a)}}async getInbox(a){let b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};try{const d=utils.simplifyEmail(a),{cookie:e,yp:f,ver:g}=await utils.getCookiesAndYP(),h=await utils.getYJ(e,g);return await utils.detailInbox(d,f,h,g,e,b,c)}catch(a){throw console.error(constants.ERROR_GET_INBOX),console.error(a.message),new Error(a)}}async readMessage(a,b,c){let d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:"";try{const{cookie:e}=await utils.getCookiesAndYP(),f=await utils.request("GET",constants.READ_MAIL_URL(a,b),constants.INBOX_HTTP_CONFIG(e,a));200!==f.statusCode&&console.log(constants.ERROR_LOAD_PAGE);const g=cheerio.load(f.body),h=g(constants.SELECTOR_SUBMIT).text(),i=g(constants.SELECTOR_FROM),j=g(constants.SELECTOR_DATE),k=i.length?i.text():g(constants.SELECTOR_FROM_ALT).text(),l=j.length?j.text().replace(k,""):g(constants.SELECTOR_DATE_ALT).text();let m;return d?(d="".concat(constants.SELECTOR_MAIL," ").concat(d),m="html"===c.toLowerCase()?g(d).html():g(d).text().trim()):(d="#mail",m="html"===c.toLowerCase()?g(d).html():g(d).text().trim()),{id:b,submit:h,from:k,date:l,selector:d,format:c,data:m}}catch(a){throw console.error(constants.ERROR_READ_MESSAGE),console.error(a.message),new Error(a)}}async deleteMessage(a,b){try{const{cookie:c,yp:d,ver:e}=await utils.getCookiesAndYP(),f=await utils.getYJ(c,e),{inbox:g}=await this.getInbox(a,{id:b});if(0<g.length){const g=constants.DELETE_MESSAGE_URL(a,b,d,f,e),h=await utils.request("GET",g,constants.INBOX_HTTP_CONFIG(c,a));return!(200!==h.statusCode)}return!1}catch(a){throw console.error(constants.ERROR_DELETE_MESSAGE),console.error(a.message),new Error(a)}}async writeMessage(a,b,c,d){try{a&&b&&c&&d||console.error(constants.ERROR_MISSING_PARAMETERS);const{cookie:e}=await utils.getCookiesAndYP(),f=await utils.request("GET",constants.WRITE_MAIL_URL(a),constants.INBOX_HTTP_CONFIG(e,a));if(200===f.statusCode){const f={msgfrom:"".concat(a,"@yopmail.com"),msgto:b,msgsubject:c,msgbody:d},g=querystring.stringify(f);let h=constants.WRITE_MESSAGE_HTTP_CONFIG(e,a);h.headers["Content-Type"]="application/x-www-form-urlencoded",h.headers["Content-Length"]=Buffer.byteLength(g);const i=await utils.request("POST",constants.SEND_MESSAGE_URL,h,g);return 200!==i.statusCode&&console.error(constants.ERROR_WRITE_MESSAGE),(i.body+"").split("|")[2]}return f.data}catch(a){throw console.error(constants.ERROR_WRITE_MESSAGE),console.error(a.message),new Error(a)}}async deleteInbox(a){try{const{cookie:b,yp:c,ver:d}=await utils.getCookiesAndYP(),e=await utils.getYJ(b,d),{inbox:f}=await this.getInbox(a);if(0<f.length){const g=f[0].id,h=constants.DELETE_INBOX_URL(a,g,c,e,d),i=await utils.request("GET",h,constants.INBOX_HTTP_CONFIG(b,a));return console.log(i),200===i.statusCode}return!1}catch(a){throw console.error(constants.ERROR_DELETE_INBOX),console.error(a.message),new Error(a)}}}module.exports=new EasyYopmail;

Error: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at EasyYopmail.readMessage (D:\Coding\JS\Projects\InstaBotnet\node_modules\easy-yopmail\index.js:1:1796)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///D:/Coding/JS/Projects/InstaBotnet/index.js:50:31

Node.js v20.5.0

facing this issue when i use your snippet from the last issue, i have put my own mail and id in place where its needed

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.