title: sending emails in a loop In PYTHON 2.7
body: <p>I am currently trying to make a program that send multiple emails to my self in a loop. I have already written 2 patches of code but i can not seem to get them to work. (I am running this on a raspberry pi so exsuse any weird directorys).</p>
  
  <p>This is my first patch of while loop code </p>
  
  <pre><code>import os
  i = 0
  while i &lt; 2:
      os.pause(4)
      os.system("home/Tyler/desktop/test.py")
      i += 1
  </code></pre>
  
  <p><strong>This opens the email "sending" part /\ .</strong></p>
  
  <p><strong>This down here is the "sending" part /</strong></p>
  
  <pre><code>import smtplib
  
  smtpUser = 'smilingexample@gmail.com'
  smtpPass = 'password'
  
  toAdd =  'Example@aim.com'
  fromAdd = smtpUser
  
  subject = 'yep'
  header = 'to: ' + toAdd + '\n' + 'From: ' + fromAdd + '\n' + 'Subject: ' + subject
  body = 'hi'
  
  print header + '\n' + body
  
  s = smtplib.SMTP('smtp.gmail.com',587)
  
  s.ehlo()
  s.starttls()
  s.ehlo()
  
  
  s.login(smtpUser, smtpPass)
  s.sendmail(fromAdd, toAdd, header + '\n\n' + body)
  
  s.quit ()
  </code></pre>