How to check if an email address is valid
Este contenido está en inglés.
A form that accepts any text will fill up with mistakes: missing letters, made-up addresses and throwaway inboxes that expire after an hour. Checking an email address before you save it prevents many of these, but there is a limit to what any check can prove. This guide explains the layers of checking, from the format of the address to the domain behind it, shows how to use the email validator and email DNS checker on Valtrinity and explains why only sending a message confirms that an inbox is real.
Layer one: check the format
The first check is syntax. An address has a local part, an @ sign and a domain, and it must not contain spaces or obviously invalid characters. A check on format catches typing errors such as a missing @ sign, a double dot or a domain with no ending. It is quick and should always be the first step in any form.
Format checks are strict in some places and loose in others. Some valid addresses look unusual, so a good check accepts a wide range of correct formats rather than rejecting anything unfamiliar.
- Looks for a missing @ sign, spaces and double dots.
- Accepts many valid but unusual formats.
Layer two: check the domain accepts mail
The part after the @ sign is a domain, and a domain that is meant to receive mail publishes MX records. These records say which servers accept messages for that domain. If a domain has no MX record, mail sent to it will almost certainly bounce, even if the format is perfect.
Worked example. A visitor types [email protected] into a sign-up form. The format is valid, but the domain has no MX record. The email validator flags the domain, and the form asks the visitor to check the spelling rather than saving an address that cannot receive mail.
- An MX record shows the domain accepts mail.
- No MX record usually means mail will bounce.
Layer three: spot disposable domains
Some domains exist only to provide temporary inboxes. These are often called disposable addresses. They can be useful to the person using them, but they make a list of contacts less reliable, because the inbox may stop working soon after sign-up. A good validator keeps a list of these domains and flags them, so you can decide whether to accept, warn or reject.
Treat a disposable flag as a signal rather than proof. A small number of genuine people do use disposable services, so a warning that asks for another address is usually kinder than a hard refusal.
- Disposable domains are flagged as a warning sign.
- Decide whether to warn or refuse, based on your own needs.
Catch typing mistakes
Many invalid addresses are almost right. A visitor types gmial.com instead of a well-known provider, or hotmial in place of a common one. Some validators suggest a correction. Use suggestions as a prompt for the visitor to check, not as an automatic change, because the intended address may be different.
- Suggest a correction and let the person confirm it.
- Never change the address without asking.
Why only a test message is certain
Every check in this guide tells you what is possible, not what is true. A domain can accept mail while the mailbox itself does not exist. A mailbox can exist and still be unread for years. The only way to confirm that an address is in use is to send a message and have the person reply or click a link.
That is why most sign-up systems send a confirmation email. The address is treated as valid once the person has acted on the message. Use the format and domain checks to catch obvious errors first, then rely on the confirmation step for certainty.
- Checks show what is possible, not whether a mailbox is in use.
- A confirmation link or reply is the only certain test.
Use the tools in the right order
Open the email validator on Valtrinity and paste the address. Review the format, domain and disposable results. If the domain looks wrong, use the email DNS checker to look at its mail records directly, and check that the MX records point where you expect.
If you manage a domain, the email DNS checker is also useful for confirming that your own mail records are set up correctly before a campaign or a launch.
- Start with the email validator.
- Use the email DNS checker for the domain records.
- Confirm with a message before relying on the address.
Herramientas mencionadas en esta guía
Email Address Validator
Check an email address is written correctly and its domain accepts mail.
Seguridad y webSPF, DKIM & DMARC Checker
Check the email records that help your messages reach the inbox.
Seguridad y webDNS Lookup
Look up A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records.
Preguntas frecuentes
Can a validator tell me if an email address exists?
Not reliably. A validator can check the format and whether the domain accepts mail, but it cannot confirm that a particular mailbox exists without sending a message. Use a confirmation step for that.
Should I block disposable email addresses?
It depends on your purpose. For a trial sign-up or a community forum, a warning may reduce abuse. For a service where you need to reach people reliably, a confirmation message is more useful than blocking a list of domains.
Why did a valid-looking address fail?
The domain may have no MX record, the mail server may be temporarily unavailable, or the address may contain a character that the form rejected. Check the domain records and try the address again.
Do I need to store the results of the check?
Only what your business needs. Keep the confirmation record that proves the person agreed to receive mail, and avoid storing extra details that you do not use.