I am writing a Python program to send an email. But every time when executing the clause:
smtpserver = smtplib.SMTP(\"smtp.gmail.com\",587)
For reference, cpython smtplib is blocking. That is, it blocks the GIL (ie Python) while connecting. Despite the claims the GIL is released on I/O, it is only released on some I/O, and SMTP connections are not such. To make it async, you need to hand the mail send to another process or thread, depending on your situation.