python smtpを利用してテキストメールを送信


くだらないことは言わないで、直接コードを貼ってください.
#!/usr/bin/python
import smtplib
from email.mime.text import MIMEText
from email.header import Header

sender = '[email protected]'
receiver = '[email protected]'
username = 'login_user'
password = 'login_passwd'

def sendMail(content,subject):
    msg = MIMEText(content,_subtype='plain',_charset='gb2312')
    msg['Subject'] = Header(subject, 'utf-8')
    smtp = smtplib.SMTP()
    #smtp.set_debuglevel(1)
    smtp.connect('smtp.your.com','587')
    smtp.starttls()
    smtp.login(username,password)
    smtp.sendmail(sender, receiver, msg.as_string())
    smtp.quit()

sendMail("this is a python send email test","hello python")