*EDIT: SOLVED IT (answer below)
I'm getting an authentication error 534 from gmail when I try to run the following code:
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login("me@gmail.com", "password")
msg = "Hello from the other side!"
server.sendmail("me@gmail.com", "me@gmail.com", msg)
server.quit()
return 'Message Sent'
I also noticed that google picked up the login attempt and flagged it as a suspicious device because I'm runnning the code from a server on AWS in another state... however, I flagged it as my device, and I'm still getting the same error. What should I do?
*I also DID turn on access for less secure apps to login.