So I send
import smtplib
server= smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
smtp.ehlo()
server.login('mail_from@gmail.com', 'my_pass')
msg='hello'
server.sendmail('mail_from@gmail.com','mail_to@gmail.com',msg)
server.quit()
I get
File "/usr/lib/python3.7/smtplib.py", line 642, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted.
Once I did this way Account -> Allow less secure app -> ON and it was OK. Recently they disabled the "Allow less secure app" feature.
Is there any way to keep sending mails?