This is my normal code in my VPS hosting which provide python 2.4
def mail(receiver,Message):
import smtplib
try:
s=smtplib.SMTP()
s.con
Is SMTP.starttls()
available? You can also do e.g.:
def mail(receiver,Message):
import smtplib
try:
s=smtplib.SMTP()
s.connect("smtp.gmail.com",587)
s.starttls()
s.login("email@gmail.com", "password")
s.sendmail("email@gmail.com", receiver, Message)
except Exception,R:
return R
Guys thanks i've found the solution and this is the solution =)
def mail(receiver,Message):
import smtplib
try:
s=smtplib.SMTP()
s.connect("smtp.gmail.com",465)
s.ehlo()
s.starttls()
s.ehlo()
s.login("email@gmail.com", "password")
s.sendmail("email@gmail.com", receiver, Message)
except Exception,R:
return R