Skip to content

About

Generate emails from 1 email

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

email-maker

Generate thousands of valid email variations from a single Gmail address with zero setup.

We take advantage of a widely known glitch where mailers (especially Gmail) ignore dots (.) inserted before the @ symbol in email addresses. By algorithmically computing all possible permutations of dots within your username, email-maker outputs a massive list of completely valid aliases that all route directly back to the very same inbox.

Use this to manage multiple accounts online, automate testing workflows, or simply have control over your inbox.

email-maker preview layout design

What it does

If your email is john@gmail.com, this module creates an array including:

  • j.ohn@gmail.com
  • jo.hn@gmail.com
  • j.o.hn@gmail.com
  • j.o.h.n@gmail.com

They all lead to exactly the same inbox. The math tells us that a standard 10-character email name will generate 512 unique aliases for you to use!

Features

  • Universal Compatible: Works smoothly in Node.js (CommonJS & ESM) AND natively within browsers.
  • Fast Algorithm: Computes thousands of variations efficiently using simple recursion.
  • Array, Object, Text: Output exactly the format you need.
  • Frontend Ready UI: Ready to plug into an HTML interface with a one-liner .download() attachment capability.

🚀 Installation

npm install email-maker

Or just use the unpkg CDN for front-end usage in your HTML <head>!

<script type="module" src="https://cdn.jsdelivr.net/npm/email-maker@latest/EmailMaker.min.js" defer></script>

💻 Usage

// Using ESM import
import EmailMaker from 'email-maker';

// Initialize with any valid email string (or just the username)
const mailBot = new EmailMaker('example@gmail.com');

// 1. Get an explicit Javascript Array 
const variationsArray = mailBot.getEmailVariations('arr');

// 2. Get an Object Map 
const variationsObject = mailBot.getEmailVariations('object');

// 3. String output grouped by comma separators
const simpleString = mailBot.getEmailVariations(', ');

// Helper console commands to quickly debug
mailBot.logVariations('arr');
mailBot.tableVariations();

// Will automatically trigger a .txt download in browser! 
mailBot.download(); 

📚 API Reference

constructor(input: string)

Initializes the instance. input can be either an email address ("john@gmail.com") or simply a username ("john"). If no domain is provided, @gmail.com is used by default. Throws an error if input contains unsafe characters.

countUsernameVariations(): number

Returns the mathematical total count of how many unique combinations will be generated. 2^(length - 1)

getEmailVariations(type: string): Array | Object | String

Gets the generated email variations based on the type specified.

  • Use 'arr' to return a native Javascript Array of strings.
  • Use 'object' to return a mapped Object literal.
  • Specify any custom delimiter (e.g. \n, or , ) and it will return a single formatted String.

download(filename: string = null)

  • In Browser: Automatically packages the computed email variations as a data:text/plain blob and triggers the browser to prompt the user to download a .txt file containing the list. The filename defaults to ${username}_variations.txt.
  • In Node: Falls back to showing a warning. You can easily do fs.writeFileSync('file.txt', mailBot.getEmailVariations('\n')) on the backend instead.

Compatibility

Although tested mainly emphasizing gmail.com, it supports generating dot variations for any domain syntax provided.

License

This project is licensed under the MIT License - see the LICENSE file for details. Happy hacking!

About

Generate emails from 1 email

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages