How can I avoid google mail server asking me to log in via browser?

后端 未结 15 1928
無奈伤痛
無奈伤痛 2020-12-04 18:13

I am trying to send emails from Django using an email configured by Google Apps, my configuration at the settings.py file looks something like this:

<         


        
相关标签:
15条回答
  • 2020-12-04 18:38

    When I tried to access my account I was sent this email consisting of this link. https://www.google.com/settings/security/lesssecureapps

    You can turn-on then possibly turn-off after you've done testing.

    0 讨论(0)
  • 2020-12-04 18:39

    I've been messing with this for a couple of hours within a cucumber/capybara/selenium test - discovered something stupid which will fix this error for good, guaranteed

    The all too familiar error:

    Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure) (Net::IMAP::NoResponseError)
    

    As it turns out, there are TWO "Allow Less Secure Apps" toggles which need to be changed to allow logins from unknown devices/IMAP.

    One here: https://myaccount.google.com/security?pli=1#connectedapps (bottom of the page)

    And one here: https://www.google.com/settings/security/lesssecureapps

    BOTH OF THESE GODFORSAKEN TOGGLES need to be changed to get rid of this error message.

    edit: from user Milothicus (https://stackoverflow.com/users/3538026/milothicus): in myaccount.google.com, under 'Sign-in & Security', select 'Connected apps & sites'. this also has an option to 'Allow less secure apps'. after turning this one on, my server could now send me an automated email.

    0 讨论(0)
  • 2020-12-04 18:40

    etusm provided two locations to turn on less secure apps:

    One here: https://myaccount.google.com/security?pli=1#connectedapps (bottom of the page)

    And one here: https://www.google.com/settings/security/lesssecureapps

    both were turned on, but my headless server still couldn't send me an email. based on JohnPang's google+ recommendation, i found a third location where i had to allow access to less secure apps:

    in myaccount.google.com, under 'Sign-in & Security', select 'Connected apps & sites'. this also has an option to 'Allow less secure apps'. after turning this one on, my server could now send me an automated email.

    0 讨论(0)
提交回复
热议问题