<div dir="ltr">Hello,<div><br></div><div>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 follows...</div><div><br></div><div><div>import time</div><div>import serial</div><div>import smtplib</div><div><br></div><div>TO = <a href="mailto:kody.wasson@gmail.com">kody.wasson@gmail.com</a></div><div>GMAIL_USER = <a href="mailto:kody.wasson@gmail.com">kody.wasson@gmail.com</a></div><div>GMAIL_PASS = shed no tears</div><div><br></div><div>SUBJECT = 'Intrusion!!'</div><div>TEXT = 'Your PIR sensor detected movement'</div><div>  </div><div>ser = serial.Serial('COM4', 9600)</div><div><br></div><div>def send_email():</div><div>    print("Sending Email")</div><div>    smtpserver = smtplib.SMTP("<a href="http://smtp.gmail.com">smtp.gmail.com</a>",587)</div><div>    smtpserver.ehlo()</div><div>    smtpserver.starttls()</div><div>    smtpserver.ehlo</div><div>    smtpserver.login(GMAIL_USER, GMAIL_PASS)</div><div>    header = 'To:' + TO + '\n' + 'From: ' + GMAIL_USER</div><div>    header = header + '\n' + 'Subject:' + SUBJECT + '\n'</div><div>    print header</div><div>    msg = header + '\n' + TEXT + ' \n\n'</div><div>    smtpserver.sendmail(GMAIL_USER, TO, msg)</div><div>    smtpserver.close()</div><div>    </div><div>while True:</div><div>    message = ser.readline()</div><div>    print(message)</div><div>    if message[0] == 'M' :</div><div>        send_email(</div><div>    time.sleep(0.5)</div></div><div><br></div><div><br></div><div>I greatly appreciate you assistance in this matter.</div><div><br></div><div>Thank you, </div><div>Kody.</div></div>