Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:16:05+00:00 2026-06-15T15:16:05+00:00

I am using poplib to get email from the POP3 server. But this error

  • 0

I am using poplib to get email from the POP3 server.

But this error occurred:

*cmd* 'USER xxx@gmail.com'
*put* b'USER xxx@gmail.com'
*get* b'+OK send PASS\r\n'
*resp* b'+OK send PASS'
*cmd* 'PASS asdasd\n'
*put* b'PASS asdasd\n'
*get* b'-ERR bad command qj1pf12899100pbb.19\r\n'
*resp* b'-ERR bad command qj1pf12899100pbb.19'

here is the python code:

import getpass, poplib
def LoginGmail( email, pa ):
    M = poplib.POP3_SSL('pop.googlemail.com', '995') 
    M.set_debuglevel(2)
    user = email
    try:
        M.user(user)
        M.pass_(pa)
    except:
        print('Invalid credentials')
    else:
        print('Successful login')

...
in main():
loginGmail('test@gmail.com','asdasd')

However, in the function, when I try to type in the password (indicate as ‘pa’) and direct input, it works. It doesnt happen for user.

Please help, i’ve been trying for a day to figure it out but seem impossible for me 🙁

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:16:06+00:00Added an answer on June 15, 2026 at 3:16 pm

    Found the problem, when it read the password:

    *cmd* 'PASS asdasd\n'
    *put* b'PASS asdasd\n'
    

    somehow it also read the \n that contains illegal character. Solve by removing the \n for each of the input value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using poplib to get email from the POP3 server. But this error
I need to download emails from the gmail inbox only using poplib.Unfortunately I do
I am using python poplib . Does a POP3 connection timeout after a period
using this code: Java Server side: ... out = new PrintWriter(this.client.getOutputStream(), true); ... public
Using Android NDK is it possible (from native C-code) to get a list of
using xmltextreader, how would I load a hashtable. XML: <base><user name=john>2342343</user><user name=mark>239099393</user></base> This was
Using Rails 3, but I guess doesn't matter. I put this in the template
Using rubular.com as a guide, I am trying to get this expression to work
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.