<p>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:</p>
<pre><code>session = smtplib.SMTP(&quot;smtp-auth.ourhosting.com&quot;, 587)
session.login(smtpuser, smtppass)
</code></pre>
<p>and it's giving me this error:</p>
<pre><code>exceptions.AttributeError :  SMTP instance has no attribute 'login' :  &lt;traceback object at 006BB1D0&gt;
</code></pre>
<p>I'm assuming this is because the <code>login()</code> method was added after python 2.1. so how do I fix this?</p>
<p>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)</p>
<p>OR</p>
<p>Do it whatever way is expected by the libsmtp in python 2.1.</p>

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