On 2020-12-29, jak <nos...@please.ty> wrote: > > you could try this way: > > # ----------- > from dns import resolver as dns > > emails=['john....@fakeserver.bah', > 'john....@gmail.com'] > > for ue in emails: > try: > mxl = dns.resolve(ue.split('@')[1], 'MX') > except: > print(f'{ue}: bad mail server') > else: > if len(mxl) > 0: > print(f'{ue}: valid mail server') > # ----------- > > ... so, having verified the sever, you should only worry about the name.
I actually have tried, that's good idea. -- Thanks -- https://mail.python.org/mailman/listinfo/python-list