https://github.com/reacherhq/check-if-email-exists Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} reacherhq / check-if-email-exists * Sponsor Sponsor reacherhq/check-if-email-exists * Notifications * Star 2k * Fork 135 Check if an email address exists without sending any email, written in Rust. reacher.email View license 2k stars 135 forks Star Notifications * Code * Issues 28 * Pull requests 2 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 5 branches 41 tags Code Clone HTTPS GitHub CLI [https://github.com/r] Use Git or checkout with SVN using the web URL. [gh repo clone reache] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @dependabot dependabot chore: Bump reqwest from 0.11.3 to 0.11.4 (#936) ... a052c30 Jun 28, 2021 chore: Bump reqwest from 0.11.3 to 0.11.4 (#936) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.3 to 0.11.4. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](seanmonstar/reqwest@v0.11.3...v0.11.4) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> a052c30 Git stats * 935 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github chore(deps): Bump async-std-resolver from 0.20.0 to 0.20.2 (#912) May 17, 2021 ci chore: Update README links (#868) Feb 8, 2021 core chore: Bump reqwest from 0.11.3 to 0.11.4 (#936) Jun 28, 2021 src chore: Update licensing wording (#859) Jan 23, 2021 test_suite chore: Bump to 0.8.23 (#932) Jun 20, 2021 .dockerignore feat: Add Dockerfile & x86_64-unknown-linux-musl target (#86) Dec 1, 2019 .editorconfig refactor!: Rename main function to check_email (#319) May 8, 2020 .gitignore refactor!: Rename main function to check_email (#319) May 8, 2020 .travis.yml ci: Update auth tokens for travis and appveyor (#905) Mar 31, 2021 CHANGELOG.md chore(release): 0.8.23 Jun 20, 2021 Cargo.lock chore: Bump reqwest from 0.11.3 to 0.11.4 (#936) Jun 28, 2021 Cargo.toml chore: Bump to 0.8.23 (#932) Jun 20, 2021 Dockerfile chore: Bump to 0.8.23 (#932) Jun 20, 2021 LICENSE.AGPL chore: Use dual-licensing (#570) Aug 29, 2020 LICENSE.md chore: Update wording around licenses (#892) Mar 22, 2021 README.md chore: Bump to 0.8.23 (#932) Jun 20, 2021 app.json chore: Update README links (#868) Feb 8, 2021 appveyor.yml ci: Update auth tokens for travis and appveyor (#905) Mar 31, 2021 rustfmt.toml chore: Add Github Actions (#94) Dec 2, 2019 View code check-if-email-exists Check if an email address exists without sending any email. Live Demo: https://reacher.email What Does This Tool Check? Why? License Commercial license Open source license Try It Yourself 1. Use the Hosted Version: https://reacher.email 2. One-Click Deploy to Heroku 3. Use Docker 4. Download the Binary 5. Usage as a Rust Library [?] JSON Output FAQ What does is_reachable: "unknown" mean? The library hangs/takes a long time/doesn't show anything after 1 minute. I have another question Build From Source Legacy Bash Script README.md Crate Docs Actions Status Travis Appveyor Github Sponsor check-if-email-exists Check if an email address exists without sending any email. Live Demo: https://reacher.email hookdoo If you don't have time to waste configuring, hosting, debugging and maintaining your own email verifier, we offer a SaaS solution that has all of the capabilities check-if-email-exists provides, plus a lot more, and all that packaged in a nice friendly web interface. If you are interested, find out more at Reacher. If you have any questions, you can contact me at amaury@reacher.email. What Does This Tool Check? Included? Feature Description JSON field How confident are we in sending an Email email to this reachability address? Can be is_reachable one of safe, risky, invalid or unknown. Is the address Syntax validation syntactically syntax.is_valid_syntax valid? Does the domain of DNS records the email address mx.accepts_mail validation have valid MX DNS records? Is the address Disposable email provided by a address (DEA) known disposable misc.is_disposable validation email address provider? Can the mail exchanger of the SMTP server email address smtp.can_connect_smtp validation domain be contacted successfully? Email Is an email sent deliverability to this address smtp.is_deliverable deliverable? Has this email Mailbox disabled address been smtp.is_disabled disabled by the email provider? Full inbox Is the inbox of smtp.has_full_inbox this mailbox full? Is this email Catch-all address address a smtp.is_catch_all catch-all address? Is the email Role account address a misc.is_role_account validation well-known role account? Is the email Free email address bound to a Issue #89 provider check known free email provider? According to the syntactic rules of Syntax the target mail validation, provider, is the Issue #90 provider-specific address syntactically valid? Honeypot Does email address detection under test hide a Issue #91 honeypot? Does this email Gravatar address have a Issue #92 Gravatar profile picture? Have I Been Has this email Pwned? been compromised Issue #289 in a data breach? Why? Many online services (https://hunter.io, https://verify-email.org, https://email-checker.net) offer this service for a paid fee. Here is an open-source alternative to those tools. License check-if-email-exists's source code is provided under a dual license model . Commercial license If you want to use check-if-email-exists to develop commercial sites, tools, and applications, the Commercial License is the appropriate license. With this option, your source code is kept proprietary. Purchase an check-if-email-exists Commercial License at https:// reacher.email/pricing. Open source license If you are creating an open source application under a license compatible with the GNU Affero GPL license v3, you may use check-if-email-exists under the terms of the AGPL-3.0. Read more about Reacher's license. Try It Yourself There are 5 ways you can try check-if-email-exists. 1. Use the Hosted Version: https://reacher.email Reacher is a simple SaaS using this library, also open-source! If you would like a high free tier to test Reacher, consider sponsoring me! You'll get 8000 free email verifications every month, and a this contribution would mean A WHOLE LOT to me. 2. One-Click Deploy to Heroku Reacher provides a fully-fledged REST backend at https://github.com/ reacherhq/backend. It is the same backend running for our main product https://reacher.email. The beckend is built using the fast web framework warp, and exposes an API endpoint for making email verifications. For an one-click deploy to Heroku, click on the purple Heroku button at reacherhq/backend. 3. Use Docker The Docker image is hosted on Docker Hub: https://hub.docker.com/r/ reacherhq/check-if-email-exists. To run it, run the following command: docker run -p 3000:3000 reacherhq/check-if-email-exists You can then send a POST request with the following body to http:// localhost:3000 to test multiple emails at once: { "to_emails": ["someone@gmail.com"] } Here's the equivalent curl command: curl -X POST -d'{"to_emails":["someone@gmail.com"]}' http://localhost:3000 Optionally, you can also pass in from_email and hello_name fields into the JSON object, see the help message below to understand their meanings. 4. Download the Binary Note: The binary doesn't connect to any backend, it checks the email directly from your computer. Head to the releases page and download the binary for your platform. Make sure you have openssl installed on your local machine. > $ check_if_email_exists --help check_if_email_exists 0.8.23 Check if an email address exists without sending any email. USAGE: check_if_email_exists [FLAGS] [OPTIONS] [TO_EMAIL] FLAGS: --http Runs a HTTP server. -h, --help Prints help information -V, --version Prints version information OPTIONS: --from-email The email to use in the `MAIL FROM:` SMTP command. [default: user@example.org] --hello-name The name to use in the `EHLO:` SMTP command. [default: localhost] --http-host Sets the host IP address on which the HTTP server should bind. Only used when `--http` flag is on. [default: 127.0.0.1] --http-port Sets the port on which the HTTP server should bind. Only used when `--http` flag is on. If not set, then it will use $PORT, or default to 3000. --proxy-host Use the specified SOCKS5 proxy host to perform email verification. --proxy-port Use the specified SOCKS5 proxy port to perform email verification. Only used when `--proxy-host` flag is set. [default: 1080] --yahoo-use-api For Yahoo email addresses, use Yahoo's API instead of connecting directly to their SMTP servers. [default: true] ARGS: The email to check. If you run with the --http flag, check-if-email-exists will serve a HTTP server on http://localhost:3000. You can then send a POST request with the following body to test multiple emails at once: { "to_emails": ["someone@gmail.com"] } Here's the equivalent curl command: curl -X POST -d'{"to_emails":["someone@gmail.com"]}' http://localhost:3000 Optionally, you can also pass in from_email and hello_name fields into the JSON object, see the help message above to understand their meanings. PRO TIP: To show debug logs when running the binary, run: RUST_LOG=debug check_if_email_exists [FLAGS] [OPTIONS] [TO_EMAIL] 5. Usage as a Rust Library In your own Rust project, you can add check-if-email-exists in your Cargo.toml: [dependencies] check-if-email-exists = "0.8" And use it in your code as follows: use check_if_email_exists::{check_email, CheckEmailInput}; async fn check() { // Let's say we want to test the deliverability of someone@gmail.com. let mut input = CheckEmailInput::new(vec!["someone@gmail.com".into()]); // Optionally, we can also tweak the configuration parameters used in the // verification. input .from_email("me@example.org".into()) // Used in the `MAIL FROM:` command .hello_name("example.org".into()); // Used in the `EHLO` command // Verify this input, using async/await syntax. let result = check_email(&input).await; // `result` is a `Vec`, where the CheckEmailOutput // struct contains all information about our email. println!("{:?}", result); } The reference docs are hosted on docs.rs. [?] JSON Output The output will be a JSON with the below format, the fields should be self-explanatory. For someone@gmail.com (note that it is disabled by Gmail), here's the exact output: { "input": "someone@gmail.com", "is_reachable": "invalid", "misc": { "is_disposable": false, "is_role_account": false }, "mx": { "accepts_mail": true, "records": [ "alt3.gmail-smtp-in.l.google.com.", "gmail-smtp-in.l.google.com.", "alt1.gmail-smtp-in.l.google.com.", "alt4.gmail-smtp-in.l.google.com.", "alt2.gmail-smtp-in.l.google.com." ] }, "smtp": { "can_connect_smtp": true, "has_full_inbox": false, "is_catch_all": false, "is_deliverable": false, "is_disabled": true }, "syntax": { "domain": "gmail.com", "is_valid_syntax": true, "username": "someone" } } You can also take a look at the documentation of this JSON object. FAQ What does is_reachable: "unknown" mean? This means that the server does not allow real-time verification of an email right now. It may happen for multiple reasons: your IP is blacklisted, the SMTP port 25 is blocked, the email account is momentarily receiving too many emails (spam protection)... or the email provider simply does not allow real-time verification at all. The details of this "unknown" case can be found in the smtp.error and mx.error fields. The library hangs/takes a long time/doesn't show anything after 1 minute. Most ISPs block outgoing SMTP requests through port 25, to prevent spam. check-if-email-exists needs to have this port open to make a connection to the email's SMTP server, so won't work behind these ISPs, and will instead hang until it times out. There's unfortunately no easy workaround for this problem, see for example this StackOverflow thread. One solution is to rent a Linux cloud server with a static IP and no blocked ports, see for example our Deploy to Heroku section. To see in details what the binary is doing behind the scenes, run it in verbose mode to see the logs. I have another question Feel free to check out Reacher's FAQ. Build From Source First, install Rust; you'll need Rust 1.37.0 or later. Then, run the following commands: # Download the code $ git clone https://github.com/reacherhq/check-if-email-exists $ cd check-if-email-exists # Build in release mode $ cargo build --release # Run the binary $ ./target/release/check_if_email_exists --help Legacy Bash Script The 1st version of this tool was a simple bash script which made a telnet call. If you would like to use that simpler version, have a look at the legacy branch. The reasons for porting the bash script to the current codebase are explained in issue #4. About Check if an email address exists without sending any email, written in Rust. reacher.email Topics rust email email-validation smtp email-verification Resources Readme License View license Releases 41 v0.8.22 Latest Mar 31, 2021 + 40 releases Sponsor this project * * https://www.paypal.me/amaurym10/20 Learn more about GitHub Sponsors Packages 0 No packages published Contributors 8 * @dependabot-preview * @amaurym * @dependabot * @hadisfr * @tyranron * @mre * @Afront * @rokoroku Languages * Rust 93.0% * Shell 5.0% * Other 2.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.