I would like to know why this code does not work. I'm on VSCode, python 3.8.0-32bit. I do not know if this problem comes from the code or from an action that I should have done on my gmail. Can you enlighten me on this please
sender_email = input(str("enter your email address: "))
password = input(str("enter your password: "))
rec_email = input(str("enter the email address to whom you want to send the message: "))
message = str("message envoyé avec python")
print(".")
server = smtplib.SMTP('smtp.gmail.com')
print(".")
server.starttls()
print(".")
server.login(sender_email,password)
print("login success")
server.sendmail(sender_email,rec_email,message)
print("email has be sent to", rec_email)```
And python sends me back:
```Windows PowerShell
Copyright (C) Microsoft Corporation. Tous droits réservés.
Testez le nouveau système multiplateforme PowerShell https://aka.ms/pscore6
PS C:\Users\*************> & C:/Users/evain/AppData/Local/Programs/Python/Python38-32/python.exe c:/Users/evain/OneDrive/Bureau/mail.py
enter your email address: ev******************4@gmail.com
enter your password: **********************
enter the email address to whom you want to send the message: ma*****************1@gmail.com
.
Traceback (most recent call last):
File "c:/Users/***********/OneDrive/Bureau/mail.py", line 8, in <module>
server = smtplib.SMTP('smtp.gmail.com')
File "C:\Users\***********\AppData\Local\Programs\Python\Python38-32\lib\smtplib.py", line 256, in __init__
raise SMTPConnectError(code, msg)
smtplib.SMTPConnectError: (421, b'Cannot connect to SMTP server 2a00:1450:400c:c09::6c (2a00:1450:400c:c09::6c:25), connect error 10060')```