I'm having difficulty getting python 2.4 to connect to gmail's smtp server. My below script doesn't ever get past "connection". I realise there is an SMTP_SSL class in later versions of python and it seems to work fine, but the production environment I have to deal with only has - and likely will only ever have - python 2.4.
print "connecting"
server = smtplib.SMTP("smtp.gmail.com", 465)
print "ehlo"
server.ehlo()
print "start tls"
server.starttls()
print "ehlo"
server.ehlo()
print "log in"
if self.smtpuser:
server.login(smtpuser, smtppassword)
Does anybody have any advice for getting the above code to work with python 2.4?