Skip to content

Bankless/email-seems-valid

Repository files navigation

email-seems-valid
An offline check to see if an email seems valid.
Contains TS or JS packages for browser or Node.js

emailSeemsValid('[email protected]'); // true

emailSeemsValid('i̇[email protected]'); // false
emailSeemsValid('[email protected]'); // false
emailSeemsValid('[email protected]'); // false


Why is this needed?

Tools like Amazon SES are picky about email addresses. It's very technical, but this library is a good offline validator that an address will work for Amazon SES and all other email senders

Usage

import { emailSeemsValid } from 'email-seems-valid';

// simple valid email addresses
emailSeemsValid('[email protected]');
emailSeemsValid('[email protected]');
// all true

// special characters
emailSeemsValid('[email protected]');
emailSeemsValid('[email protected]');
emailSeemsValid('ñ[email protected]');
emailSeemsValid('i̇[email protected]');
// all false (Amazon SES rejects exclamation points)

// common mis-spellings
emailSeemsValid('[email protected]');
emailSeemsValid('[email protected]');
emailSeemsValid('[email protected]');
// all false

This library does not provide accurate true/false all emails, but it works for 99.95%.


Trusted By

• Earnifi

Want to be added to this list? Submit a pull-request today!


More Details

Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination email address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as described in RFC3492.

Read more here