[Tutor] Invalid syntax issue
rider.kody at gmail.com
Mon Nov 3 00:55:50 CET 2014
I am trying to use a code from Adafruit to have Python send an email when
triggered by my Arduino. I'm a novice to programming so it"s somewhat hard
for me. I used the code copied verbaticm only changing my email and
password, the email in there is a temporary one so I'm not worried about
you all having it. When I try to check it or run it it comes up with
"invalid syntax" and highlights the first "@" symbol. The code is as
TO = kody.wasson at gmail.com
GMAIL_USER = kody.wasson at gmail.com
GMAIL_PASS = shed no tears
SUBJECT = 'Intrusion!!'
TEXT = 'Your PIR sensor detected movement'
ser = serial.Serial('COM4', 9600)
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
header = 'To:' + TO + '\n' + 'From: ' + GMAIL_USER
header = header + '\n' + 'Subject:' + SUBJECT + '\n'
msg = header + '\n' + TEXT + ' \n\n'
smtpserver.sendmail(GMAIL_USER, TO, msg)
message = ser.readline()
if message == 'M' :
I greatly appreciate you assistance in this matter.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor