B
B
Bekzoro2021-02-03 05:13:36
Python
Bekzoro, 2021-02-03 05:13:36

How to check mail in Aiogram?

Good day, tell me please, how to make mail verification?
The user in Telegram enters his mail and he gets to the next stage to enter the code, and the code at this time should come to the mail that he indicated

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2021-02-11
@fifty59nine

Try:

import re
def is_email(text):
     patern = '^[\w-\.][email protected]([\w-]+\.)+[\w-]{2,4}$'
     if re.match(patern, text):
         return True
     else:
         return False

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question