If you want to avoid external dependencies for a basic project, you can use Python's built-in re module. Note that a "perfect" regex for all valid emails is extremely complex, so most developers use a simplified version. :

: An example of an online tool that runs 15+ checks, including MX record and SMTP verification. email-validator - PyPI

The most recommended approach for production is using the library. It checks syntax, normalizes characters (like converting internationalized domains to Punycode), and can optionally verify that the domain has valid DNS records. Installation : pip install email-validator Basic Code Snippet :