Email Validation

In the article, the process and significance of email validation are examined, as well as the details on the validation stages, potential causes of email invalidity, and methods for correcting email addresses are provided.

💬

Email Validation is a verification that ensures the email address meets the requirements and is eligible to be used for emailing.

Often, users provide incorrect emails on purpose or by mistake. These incorrect addresses are stored in the general email database and later used for emailing. Consequently, the database accumulates a number of invalid email addresses, leading to decreased email marketing effectiveness and a higher risk of emails getting into the "Spam" folder in real users' inboxes.

🚧

The higher the number of non-existent or invalid email addresses in the database, the greater the chance for the emails to end up in spam.

Stages of the email validation process

💬

A Mail eXchanger (MX record) is a DNS record that points to a mail server. The Domain without this record will not accept emails. The validator checks the address for the presence of an MX record and its correctness.

Bringing the email address to the correct format

Bringing a user's email to the correct format consists of checking the following parameters:

  1. Correction of the email Domain spelling (e.g., gmail.co will be corrected to gmail.com);
  2. Rectifying symbols written in Cyrillic to the corresponding Latin character on the keyboard layout (e.g., replacing the symbol "ш" with "i");
  3. Removal of special characters from the email address (e.g., spaces, quotation marks, !?##$ characters, etc.).

📘

Only numbers (0-9), letters (A-Z) and symbols "@", "-" and "_" can be used in the email address.

When does email validation take place?

The system automatically validates email addresses before sending an email (e.g., when using the АPI endpoint send system / trigger emails). Additionally, you can use a separate АPI endpoint Check email to validate the email address before making sends.

📘

When sending an email, the system by default replaces potential errors with the assumed Domain name and automatically brings the email address to the correct format. Afterwards, the email address is checked again for other criteria.

By using the АPI endpoint Check email, you can indicate in the request that you do not want to convert the email address to the correct format by indicating "false" for the sanitize parameter.

Possible reasons why the email address may be invalid

Reason valueDescription
invalidIncorrect email format;
mx_recordThere is no MX record for the mail Domain;
applicationEmail address refers to the application (e.g., fb.com);
systemSystem email (e.g., [email protected]);
blacklistedThe email address is on the blacklist;
mx_record_blacklistedMX record of the email address is on the blacklist;
mx_ip_blacklistedThe IP address of the MX record is on the blacklist.

How to use the API endpoint Check email?

We recommend using this API endpoint before sending emails, so if the user's email address is invalid, you can immediately see the reason.

Also, the request to this API endpoint does not create a new user in our system, unlike the API endpoint Send system / trigger emails). Therefore, there will be fewer invalid users in the database, and we will not try to send emails to non-existent email addresses.

Why must you validate an email address before sending an email?

If the user's email address was invalid and we corrected the errors while bringing the email address to the correct format via the API endpoint Check email, you should update the data on your side accordingly.

Why is it important?

Let's take the following scenario as an example:

  • You skipped the step of email validation with the API endpoint Check email and immediately sent the email to the user;
  • But when registering on the site, this user made a mistake and provided an incorrect email address;
  • When sending the email, the validator corrected the error and converted the email address to the correct format, so now we have the correct email address in our database;
  • However, since you didn't use the API endpoint Check email, you don't even realize that there was a mistake in this user's email address;
  • As a result, your database will contain the original email address – with an error that differs from the one in our database.

❗️

In the future, if you need to find any information about this user by their email address, you will not be able to do so, as this user does not exist in our system.

Now let's look at another scenario:

  • The user's email address turned out to be incorrect after verifying it, and we can't fix it on our end;
  • But using the API endpoint Check email, you can find out about it in a timely manner and ask the user to provide the correct email address for further communication.

What information can you get when bringing the email address to the correct format?

When using the API endpoint Check email, if you indicate the parameter "true" for the sanitize value, you will receive the following data in response:

  • Orig – the user's original email address, which you specified in the request;
  • Valid – informs if the email is valid: "true" (valid) / "false" (invalid);
  • Email – corrected user's email address, which will be saved in the system and which you need to use in the future (relevant if the value is valid = "false").

Sending emails to invalid or invalid email addresses

What happens when sending system / trigger emails to an invalid or non-existent user email address?

  1. The user is created in our system;
  2. During the attempt to send them the first email, you will receive a webhook "Lost";
  3. After that, the user will be unsubscribed from emails. You can see the reason for this in the User Profile - Unsubscribes section of the Sendios admin panel: in the Unsubscribe regular emails field, it will be indicated that the user has been unsubscribed due to an invalid or non-existent email address (source_id = 10, which means invalid);

  1. When re-sending emails to an invalid / nonexistent user email address, you will receive a "Reject" webhook with the reject reason "unsubscribe."

🚧

Email addresses that have not passed validation before sending the email will automatically acquire the "Invalid" status. Such users will be unsubscribed, and no emails will be sent to their email addresses.

If the user's email address is blacklisted, then the user will NOT be automatically unsubscribed. But when trying to send an email to this email address, you will receive a "Reject" webhook with the corresponding reason indicated.