Socket
Socket
Sign inDemoInstall

1secmail-api

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

1secmail-api

A Node API for 1secmail.com


Version published
Weekly downloads
941
increased by9.42%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

1secmail-api

A NodeJS API for 1secmail.com

Examples and usage

The below example creates an email account at exampleAccount@1secmail.com and fetches emails every 10 seconds.

const { TempMail } = require("1secmail-api");

// Create email account
const mail = new TempMail("exampleAccount");

// Enable auto-fetching full emails
mail.autoFetch();

// Wait until the client is ready
mail.onReady(() => {
  // Should show: exampleAccount@1secmail.com
  console.log("Email ready! Address:", mail.address);

  // Get emails every 10 seconds
  const fetch = () => {
    mail.getMail().then((mails) => {
      console.log(mails);

      mail.deleteMail();
    });
  };

  fetch();
  setInterval(fetch, 10 * 1000);
});

You can also chose different domains by passing an extra argument to the TempMail constructor:

// john@esiix.com
const mail = new TempMail("john", "esiix.com");

To generate random email addresses use mail

mail.getRandomAddress();

To download an attachment use mail.getAttachment(id, file) and pass the email ID and the file name.

Keywords

FAQs

Last updated on 26 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc