# Send e-mail function
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
def send_email(_me):
emailhost='send.mx.example.com'
title='It is test e-mail'
bodytext='This mail informs you of the error about certain service with probe checking logic.' + '\n If you received this email, please check it.\n \n' + _me
sender='me@example.com'
receiver=['who@example.com']
msg=MIMEText(bodytext)
msg['Subject']=title
msg['From']=sender
msg['To']=', '.join(receiver)
s=smtplib.SMTP(emailhost)
s.sendmail(sender, receiver, msg.as_string())
s.close()
send_email(_me)
callIEM1(_me)
'Development > Python' 카테고리의 다른 글
tcp connection 확인용 스크립트 (0) | 2024.06.14 |
---|---|
How to automatically stop Aurora MySQL RDS Clusters (0) | 2023.02.16 |
automatically upload AWS WorkDocs files to specific AWS S3 in AWS cross account (0) | 2023.02.16 |