title: Python smtplib only sending message body
body: <p>Using Python, I wrote a simple timer that sends an email when the timer reaches 0. But the only part of the message being sent is the body. The sender address, recipient address, and subject are not being sent. Here is the code:</p>
  
  <pre><code>#Coffee timer
  import smtplib
  
  #Set timer for 00:03:00
  from time import sleep
  for i in range(0,180):
  print(180 - i),
  sleep(1)
  print("Coffee is ready")
  
  print("Sending E-mail")
  
  SUBJECT = 'Coffee timer'
  msg = '\nCoffee is ready'
  TO = 'email-B@email.com'
  FROM = 'email-A@email.com'
  
  server = smtplib.SMTP('192.168.1.8')
  server.sendmail(FROM, TO, msg, SUBJECT)
  server.quit()
  
  print("Done") 
  </code></pre>
  
  <p>Can anyone explain why this is happening/what I can do to resolve it?</p>