Skip to content

Instantly share code, notes, and snippets.

@yujuwon
Created July 4, 2013 05:27
Show Gist options
  • Select an option

  • Save yujuwon/5925104 to your computer and use it in GitHub Desktop.

Select an option

Save yujuwon/5925104 to your computer and use it in GitHub Desktop.
import smtplib
from email.MIMEText import MIMEText
def sendMail() :
HOST = 'smtp.server.com' # smtp 호스트 주소
me = '[email protected]' # 보내는 사람 메일 주소
you = '[email protected]' # 받는 사람 메일 주소
contents = '프로그램 뻗었다!!'
msg = MIMEText(contents, _charset='euc-kr')
msg['Subject'] = '[ALERT]'
msg['From'] = me
msg['To'] = you
s = smtplib.SMTP(HOST)
s.sendmail(me, [you], msg.as_string())
s.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment