Check if an email address exists before sending the email.
Many online services (https://hunter.io, http://verify-email.org, http://email-checker.net) offer this service for a paid fee. Here is an open-source alternative to those tools.
Head to the releases page and download the binary for your platform.
Make sure you have openssl
installed.
USAGE:
check_if_email_exists [OPTIONS] <TO_EMAIL>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--from <FROM_EMAIL> The from email to use in the SMTP connection (default: [email protected])
ARGS:
<TO_EMAIL> The email to check
To show debug logs when running the binary, run:
RUST_LOG=debug check_if_email_exists [OPTIONS] <TO_EMAIL>
Most ISPs block outgoing SMTP requests through ports 25, 587 and 465, to prevent spam. check_if_email_exists
needs to have these ports 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.
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 here.
First, install Rust. Then, clone the source code locally:
# Download the code
$ git clone https://github.com/amaurymartiny/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
See the LICENSE file.