to = 'recipient@mail.com'
gmail_user = 'some.user@gmail.com'
gmail_pwd = 'password'
smtpserver = smtplib.SMTP("smtp.gmail.com", 465)
smtpserver.helo()
smtpserver.login(gmail_user, gmail_pwd)
header = 'To:' + to + '\n' + 'From: ' + gmail_user + '\n' + 'Subject: Email from the WiPy \n'
msg = header + '\n Hi, \n this is The WiPy emailing

smtpserver.sendmail(gmail_user, to, msg)
smtpserver.close()
Also I am using the smtplib library provided there, the users there say it works, however I get the following error
Traceback (most recent call last):
File "<stdin>", line 19, in <module>
File "smtplib.py", line 84, in __init__
File "smtplib.py", line 110, in connect
AttributeError: 'module' object has no attribute 'IPPROTO_SEC'
Which basically happens when trying to create de smtplib.SMTP object. What is the problem here?