#!/usr/bin/env python

import smtplib

import string

HOST = "smtp.sina.cn"

SUBJECT = "Test mail from python"

TO = "[email protected]"

FROM = "[email protected]"

text = "python rules them all!!!"

BODY = string.join((

         "From:%s" % FROM,

         "To:%s" % TO,

         "subject:%s" % SUBJECT,

         "",

         text

         ),"\r\n")

server=smtplib.SMTP()

server.connect(HOST,25)

server.starttls()

server.login("[email protected]","******")

server.sendmail(FROM,TO,BODY)

server.quit()