How an email address that doesn't exist can ruin my business?
Mail servers do not only exchange messages between them; they also have several mechanisms to fight against spam. An email server that receives too many messages destined to unexisting domains can automatically report the emitting domain as a potential spamming source.
Once your domain name received multiple spam suspicion reports, you could be considered a spammer and your mail server could be blacklisted. The consequence is that most of your emails will be blocked by spam filters before they have a chance to reach your recipients' mailboxes.
There are several ways to reduce the risk of being blacklisted. The first and easiest mechanism to set-up is to implement an email address verification script which ensures that the recipient's domain exists and contains email servers.
Why not check the existence of the mailbox against the recipient's SMTP server?
Those who know the SMTP protocol might want to implement a verification script to send the recipient's mail server the VRFY command. The VRFY command allows you to verify a mailbox's existence on an SMTP server, which could have been convenient in our situation. Unfortunately, most SMTP servers do not respond correctly to the VRFY command, making it unusable.
What is the best method to verify MX fields and SMTP configuration?
The fastest and cheapest way is to use an API to verify the email address's domain configuration.
Abstract Email Verification API is free and easy to use. It provides information on the MX fields and the SMTP server and additional interesting data about an email address, in real-time.
To use it, you only need to create an account on the Abstract website. Then you are ready to use the API. Here is an example with a curl command:
curl "https://emailvalidation.abstractapi.com/v1/?api_key=YOUR_API_KEY&email=johnsmith@gmail.com"
And here is the response:
{
"email": "johnsmith@gmail.com",
"autocorrect": "",
"deliverability": "DELIVERABLE",
"quality_score": 0.90,
"is_valid_format": {
"value": true,
"text": "TRUE"
},
"is_free_email": {
"value": true,
"text": "TRUE"
},
"is_disposable_email": {
"value": false,
"text": "FALSE"
},
"is_role_email": {
"value": false,
"text": "FALSE"
},
"is_catchall_email": {
"value": false,
"text": "FALSE"
},
"is_mx_found": {
"value": true,
"text": "TRUE"
},
"is_smtp_valid": {
"value": true,
"text": "TRUE"
},
"quality_score": 0.90,
}