This is a straightforward microservice that returns three markers which can be used to determine whether an email is valid. Extremely useful for the sign up stage of any application.
https://email-verification-microservice.onrender.com/api/email/verifyThis is hosted on render free tier so it can take >50s if the instance is inactive!, however response should be <1s (blazing fast!) afterwards
curl -X POST https://email-verification-microservice.onrender.com/api/email/verify -H "Content-Type: application/json" -d "{\"email\": \"test@example.com\"}"It is by defualt configured to run on port 8080 when running locally.
Returns a JSON formatted as such:
{
"email": "test@example.com",
"validDomain": true,
"disposable": false,
"validSyntax": true
}- validDomain checks hostname lookup and uses socket to establish a connection with the domain. Returns true if these two tests are a success.
- disposable checks a comprehensive list of disposable email domain names to determine whether the domain is used for disposable email addresses.
- validSyntax implements a basic regex check to ensure the email is formatted correctly.
To run the server on your local machine:
mvn spring-boot:runor to get a jar build to deploy:
mvn clean packageand a jar file will be created in the target folder