사용자 도구

사이트 도구


python:smtplib

문서의 이전 판입니다!


Python SMTPLib/Email

    import smtplib
    from email.MIMEText import MIMEText
    from email.Header import Header
 
    smtp = smtplib.SMTP("smtp.host.com")
 
    contents = u"Unicode 내용"
 
    msg = MIMEText(contents.encode("utf-8"), "plain", "utf-8")
    msg["From"] = str(Header(u"보내는이이름", "utf-8"))
    msg["To"] = str(Header(u"받는이","utf-8"))
    msg["Subject"] = str(Header(u"제목","utf-8"))
 
    smtp.sendmail("보내는이메일주소", "받는이메일주소", msg.as_string())
python/smtplib.1325588498.txt.gz · 마지막으로 수정됨: 2012/01/03 20:01 저자 kwon37xi