Python Code To Check EMAIL Address Is Valid | regex & dnspython | how to check MX record

Published: 17 January 2021
on channel: Python 360
5,299
72

How to check if an email address is a valid format and if the MX record / domain exists for any given email address.

My code also checks for common miss-spellings and gives a suggestion.

-- chapters --

0:00 Introduction
1:00 dnspython
2:23 pip3 install dnspython
5:14 re.search
8:00 suggest corrections to email address
10:16 gmail v gmial v gmal
12:41 regex pattern for valid email address
14:12 raise ValueError
15:20 check for mx record

re.search v re.match
=================
🌏 https://stackoverflow.com/questions/1...

The Code on GitHub:
================
🌏 https://github.com/RGGH/Python/blob/m...

Visit redandgreen blog for more Tutorials
=========================================
🌏 http://redandgreen.co.uk/about/blog/

Subscribe to the YouTube Channel
=================================
🌏    / drpicode  

Follow on Twitter - to get notified of new videos
=================================================
🌏   / rngweb  

Buy Dr Pi a coffee (or Tea)
☕ https://www.buymeacoffee.com/DrPi

Thumbs up yeah? (cos Algos..)

Proxies
=================================================
If you need a good, easy to use proxy, I was recommended this one, and having used ScraperAPI for a while I can vouch for them. If you were going to sign up anyway, then maybe you would be kind enough to use the link and the coupon code below?

You can also do a full working trial first as well, (unlike some other companies). The trial doesn't ask for any payment details either so all good! 👍

🌏 10% off ScraperAPI : https://www.scraperapi.com?fpr=ken49
◼️ Coupon Code: DRPI10
(You can also get started with 1000 free API calls. No credit card required.)

#email #tutorials #python


Watch video Python Code To Check EMAIL Address Is Valid | regex & dnspython | how to check MX record online, duration hours minute second in high quality that is uploaded to the channel Python 360 17 January 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 5,299 times and liked it 72 visitors.