0

I have some problems with sending emails using smtplib, I know the problem is not with my code because I reused code that worked last year. After some digging, I found the problem and that is

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign into your Google Account using only your username and password.

Important: This deadline does not apply to Google Workspace or Google Cloud Identity customers. The enforcement date for these customers will be announced on the Workspace blog at a later date.

And what this means that all the previous information previous to May 30 is now useless, my code included, so how do I make it work considering this new information.

Here's the code if it matters

def mail(sender, password, reciever, message): 
    with smtplib.SMTP_SSL("smtp.gmail.com", port, context=context) as server:
        server.login(sender, password)
        server.sendmail(sender, reciever, message)

And the port is 465, tried others as well, still does not work.

Bambi2k21
  • 15
  • 7

0 Answers0