Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Validates regex, typos, disposable, dns and smtp

License

NotificationsYou must be signed in to change notification settings

mfbx9da4/deep-email-validator

Repository files navigation

Validates email addresses based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.

  • Validates email looks like an email i.e. contains an "@" and a "." to the right of it.
  • Validates common typos e.g.example@gmaill.com usingmailcheck.
  • Validates email was not generated by disposable email service usingdisposable-email-domains.
  • Validates MX records are present on DNS.
  • Validates SMTP server is running.
  • Validates mailbox exists on SMTP server.
  • Native typescript support.

Getting Started

Compatible with nodejs only. Not browser ready.

Install like so

npm i deep-email-validator --save

or with yarn

yarn add deep-email-validator

Use like so

import{validate}from'deep-email-validator'constmain=async()=>{letres=awaitvalidate('asdf@gmail.com')// {//   "valid": false,//   "reason": "smtp",//   "validators": {//       "regex": {//         "valid": true//       },//       "typo": {//         "valid": true//       },//       "disposable": {//         "valid": true//       },//       "mx": {//         "valid": true//       },//       "smtp": {//         "valid": false,//         "reason": "Mailbox not found.",//       }//   }// }// Can also be called with these default optionsawaitvalidate({email:'name@example.org',sender:'name@example.org',validateRegex:true,validateMx:true,validateTypo:true,validateDisposable:true,validateSMTP:true,})}

If you want to validate domains with TLDs that are not supported by default, you can useadditionalTopLevelDomains option:

awaitvalidate({email:'name@example.ir',sender:'name@example.ir',validateRegex:true,validateMx:true,validateTypo:true,validateDisposable:true,validateSMTP:true,additionalTopLevelDomains:['ir']})

For a list of TLDs that are supported by default you can seehere.

Default options can be found here

About

Validates regex, typos, disposable, dns and smtp

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors11


[8]ページ先頭

©2009-2025 Movatter.jp