How To Send An Email Using Python
'
import smtplib HOST = "smtp.mydomain.com" SUBJECT = "Test email from Python" TO = "[email protected]" FROM = "[email protected]" text = "Happy Coding" BODY = "\r\n".join((f"from:{FROM}",f"To:{TO}",f"Subject:{SUBJECT}","",text)) Server =smtplib.SMTP(HOST) Server.sendmail(FROM,[TO],BODY) Server.quit()
No comments: