2

I'm using a python library to log into Gmail. Pretty simple to get started with. I'm trying to log into my account via this code.

import gmail     
g = gmail.login(username, password)

and I receive this error

gmail.exceptions.AuthenticationError

Because google blocked the sign in attempt.

enter image description here

My question is that, is there a way to better authenticate to gmail so Google doesnt block my requests to sign in? I rather not go through the process of generating an OAuth code only because I have multiple gmail accounts I want to log into and retrieve emails from.

Thanks!

Community
  • 1
  • 1
k9b
  • 1,457
  • 4
  • 24
  • 54
  • 1
    you can set up your gmail account to allow less secure apps to access ... (but either way you will have to do it within your gmail acct ... either generate an "app token" or allow less secure apps) – Joran Beasley Feb 26 '16 at 18:04
  • as an aside here is how to make your app more secure (its more painful i think) http://stackoverflow.com/questions/25944883/how-to-send-an-email-through-gmail-without-enabling-insecure-access – Joran Beasley Feb 26 '16 at 18:07
  • Thanks for the responses! I'll look up making accounts less secure to access and that answer. – k9b Feb 26 '16 at 18:11

0 Answers0