mail.tm
v0.0.5
Published
A npm package that utilizes mail.tm's API into a much more friendlier integration
Downloads
8
Readme
➤ Installation
npm install mail.tm
➤ Getting Started
NOTE: Each method is async/await
This is to create separate instances for each mail account to login to.
Example without any additional extensions:
const MailClient = require("mail.tm");
const mail = new MailClient();
Example with additional extensions:
const MailClient = require("mail.tm");
const mail = new MailClient("mail.tm", "apollo30.xyz");
➤ Registering an account
Registering an account with a specific domain that is integrated to mail.tm
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.register("[email protected]", "qwerty123");
// { status: true, data: {...} }
➤ Generating a random account
Generate an account with a random extension
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.generateAccount();
// { status: true, data: { username: "[email protected]", password: "58u35h3xzpv" } }
// { status: true, data: { username: "[email protected]", password: "35gasfyhdas" } }
Generate an account with a specific extension
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.generateAccount("mail.tm");
// { status: true, data: { username: "[email protected]", password: "awt335shruji" } }
➤ Account Utilities
Login to an account
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.login("[email protected]", "qwerty123");
// { status: true, data: {...} }
Fetch the logged in account
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.fetch();
// { status: true, data: {...} }
Delete the logged in account
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.delete("1234567890");
// { status: true, data: {...} }
Fetch messages sent to the email
const MailClient = require("mail.tm");
const mail = new MailClient();
await mail.fetchMessages(1);
// { status: true, data: {...} }