I'm writing a small python script to send an email, but my code isn't even getting past smtp connection. I'm using the following code, but I never see "Connected". Additionally, I'm not seeing an exception thrown, so I think it's hanging on something.
import os
import platform
import smtplib
#Define our SMTP server. We use gmail. Try to connect.
try:
server = smtplib.SMTP()
print "Defined server"
server.connect("smtp.gmail.com",465)
print "Connected"
server.ehlo()
server.starttls()
server.ehlo()
print "Complete Initiation"
except Exception, R:
print R