Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sebastianfoth/email-address-existence

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sebastianfoth/email-address-existence

A library written in Typescript which tries to check if an email address really exists

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-38.33%
Maintainers
1
Weekly downloads
 
Created
Source

About

A library written in Typescript which tries to validate if an email address really exists by connecting to the responsible email server.

How to install

npm install @sebastianfoth/email-address-existence --save

Usage / Howto

import { EmailAddressExistenceService, EmailValidationStatus } from '@sebastianfoth/email-address-existence';

const service = new EmailAddressExistenceService();
const result = await service.validate({
  recipient: 'MAIL_ADDRESS_TO_CHECK_FOR_EXISTENCE',
  sender: 'YOUR_MAIL_ADDRESS',
  timeout: 3000,
  portTelnet: 25,
  debug: true,
});

if (result === EmailValidationStatus.MAY_EXISTS) {
  // Yay, the address might exists
}

The method validate() returns Promise<EmailValidationStatus>.

Possible values of EmailValidationStatus

EmailValidationStatus.NOT_FOUND

The email address wasn't found on the mail server

EmailValidationStatus.INVALID_SYNTAX

Invalid email address

EmailValidationStatus.BLOCKED_BY_PROVIDER

Our identification method is blocked by the provider and/or your IP is blacklisted

EmailValidationStatus.TIMEOUT

Timeout while trying to connect to the email server

EmailValidationStatus.MAY_EXISTS

The email address might exists

Caveats

Email providers know how to protect their users, please keep the following things in mind:

  • Some email servers might always say that the specific email address exists
  • Some email servers might always say that the specific email address doesn't exist
  • Some email servers block your IP in case you perform too many queries

Please keep the things mentioned above in mind in case you are using this library. Always try to revalidate the responses by checking addresses you are aware they exist and also do the opposite: Check for addresses which unlikely exist by choosing a random string as username (i.e. jhuihgiuwehiugwh@gmail.com).

TODOs

  • I guess we need a licence
  • Documentation
  • Extend Options
  • General cleanup
  • Tests
  • Input validation
  • Building Process

Keywords

FAQs

Package last updated on 08 Jul 2019

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc