Question #241177 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/241177
Ador Juan Cruz proposed the following answer:
still cant figure out why this code works on python but not on sikuliX
def send_email(mySubject, myMsg):
gmail_user ="[email protected]"
gmail_pwd = "password"
FROM = '[email protected]'
TO = ['[email protected]'] #must be a list
timeStr = time.strftime("%Y-%m-%d %H:%M:%S")
SUBJECT = timeStr + mySubject
TEXT = myMsg + "\r\n" + timeStr
# Prepare actual message
message = """\From: %s\nTo: %s\nSubject: %s\n\n%s
""" % (FROM, ", ".join(TO), SUBJECT, TEXT)
try:
server = smtplib.SMTP_SSL()
server.connect('smtp.gmail.com', 465)
server.login(gmail_user, gmail_pwd)
server.sendmail(FROM, TO, message)
server.quit()
print 'successfully sent the mail'
except:
print "failed to send mail"
send_email("This is the subject", "Hello World")
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.
_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help : https://help.launchpad.net/ListHelp