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

simple-email-verifier

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-email-verifier

Email verification by looking for SMTP records and account existence checking

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Simple Email Verification

This class can help you to check that some email is realy exists in the Internet. For example, if you don't want to send email verification message with code, but just want to check that email wasn't generated by RANDOM_EMAIL() function.

Method

  1. First, it's a simple regular expression checking. Verify that email have a normal format.
  2. Second, it's looking for MX records by DNS resolving.
  3. And the last step is checking for account exists in the SMTP server by sending some protocol messages.

Installation

npm i simple-email-verifier

Usage

const { EmailVerifier } = require("simple-email-verifier");

let verifier = new EmailVerifier(10000);

verifier.verify("admin@vk.com").then(result => {
  if (result) {
    console.log("This email realy exists :)");
  } else {
    console.log("Email not found :(");
  }
}).catch(console.error);

API

  • EmailVerifier(timeout: number, dnsCacheSettings: Object, mailFrom: string) - Main verifier class, where mailFrom - is your random server email, timeout - is timeout for email verify in .verifySmtpRecord() method. And dnsCacheSettings are settings for dnscache package.
  • verifier.verify(email: string): Promise<boolean> - Full email verify promise.
  • verifier.isValidEmail(email: string): boolean - Validate email by regular expression.
  • verifier.getEmailDomain(email: string): string - Get email domain after @ symbol.
  • verifier.checkMx(email: string): Promise<[]MxRecord> - Look for MX records by DNS resolve.
  • verifier.verifySmtpRecord(mxRecord: string, email: string): Promise<boolean> - Check email account existing in the SMTP server.

Typings

Some types of this module.

MxRecord

MX record object

  • exchange - Mail Exhange
  • priority - Exchange priority

Keywords

FAQs

Package last updated on 05 Oct 2021

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