def email_send(SUBJECT , message): print("send email...") FROM = "my email" TO = "his/her email" MESSAGE = MIMEMultipart('alternative') MESSAGE['subject'] = SUBJECT MESSAGE['To'] = TO MESSAGE['From'] = FROM HTML_BODY = MIMEText(message, 'html') MESSAGE.attach(HTML_BODY) server = smtplib.SMTP("smtp.gmail.com:587") password = "my code" server.starttls() server.login(FROM,password) server.sendmail(FROM , TO , MESSAGE.as_string() ) server.quit() return TO
email_send("Some title" , "Hello\nHow\nare\nyou")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)