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

  • SEARCH
  • Home
  • 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 75679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:33:14+00:00 2026-05-10T20:33:14+00:00

Hey I have a windows server running python CGI scripts and I’m having a

  • 0

Hey I have a windows server running python CGI scripts and I’m having a little trouble with smtplib. The server is running python 2.1 (unfortunately and I can not upgrade it). Anyway I have the following code:

session = smtplib.SMTP("smtp-auth.ourhosting.com", 587) session.login(smtpuser, smtppass) 

and it’s giving me this error:

exceptions.AttributeError :  SMTP instance has no attribute 'login' :  <traceback object at 006BB1D0> 

I’m assuming this is because the login() method was added after python 2.1. so how do I fix this?

I have to either add the module by uploading the files to the same directory as the cgi script (though I believe smtplib is written in C and needs to be compiled which we can’t do on this server)

OR

Do it whatever way is expected by the libsmtp in python 2.1.

  • 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. 2026-05-10T20:33:15+00:00Added an answer on May 10, 2026 at 8:33 pm

    login() was introduced in Python 2.2, unluckily for you! The only way to do it in Python 2.1’s own smtplib would be to issue the AUTH commands manually, which wouldn’t be much fun.

    I haven’t tested it fully but it seems Python 2.2’s smtplib should more or less work on 2.1 if you copy it across as you describe (perhaps call it smtplib2.py). It’s only a Python module, no C compilation should be necessary. However you will at least need to copy the hmac.py library it relies on from 2.2’s lib as well. If you use a later Python version to steal from it starts requiring the email package too which might be more work.

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

Sidebar

Ask A Question

Stats

  • Questions 84k
  • Answers 84k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer On windows you can use the ExitWindows function described here:… May 11, 2026 at 4:58 pm
  • Editorial Team
    Editorial Team added an answer It should be: var divContainerID = "divBlock1"; $('#'+divContainerID).show(); if divContainerID… May 11, 2026 at 4:58 pm
  • Editorial Team
    Editorial Team added an answer Previous versions of Excel and Access (prior to 2003) supported… May 11, 2026 at 4:58 pm

Related Questions

Hey I have a windows server running python CGI scripts and I'm having a
Hey all, I'm pulling my hair out on this one. I've checked all my
I have a copy of emacs that I use on a couple of different
I have a huge mbox file, with maybe 500 emails in it. It looks
I have a single spool mbox file that was created with evolution, containing a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.