from smtplib import SMTP
try:
subcjet = "Subject"
message = "Message!"
content = "Subject: {0}\n\n{1}".format(subcjet,message)
myMailAdress = "mail"
password = "password"
sendTo = "sendmail@mail.xyz"
mail = SMTP("smtp.gmail.com", 587)
mail.ehlo()
mail.starttls()
mail.login(myMailAdress,password)
mail.sendmail(myMailAdress, sendTo, content.encode("utf-8"))
print("Sending...")
print("Sent!")
except Exception as e: print("Error!\n {0}".format(e))