0

*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.

mnot
  • 161
  • 1
  • 4
  • 16
  • Possible duplicate of [How to use GMail as a free SMTP server and overcome captcha](http://stackoverflow.com/questions/1607828/how-to-use-gmail-as-a-free-smtp-server-and-overcome-captcha) – tripleee Jul 11 '16 at 07:56

1 Answers1

1

After telling google that it WAS my device, I just had to do this before the changes could propagate!

https://accounts.google.com/DisplayUnlockCaptcha

Problem = Solved

mnot
  • 161
  • 1
  • 4
  • 16