title: Send an email in Python and include a vaiable in the subject line
body: <p>I am trying to include a variable in the subject line of a Python email script to send a message to my phone.  When I run the program, the message has "The Temp is: CTemp", but I want "The Temp is: 12.34" (or whatever the variable is set to at that time).  How do I insert the variable CTemp into the subject line?</p>
  
  <pre><code>import smtplib
  from email.mime.text import MIMEText
  
  username = "****@****.com"
  password = "****"
  vtext = "**********@****.com"
  
  CTemp = 12.34 #set for testing
  
  msg = MIMEText
  msg = MIMEText("""The Temp is: CTemp""")
  
  server = smtplib.SMTP('****.****.net',25)
  server.login(username,password)
  server.sendmail(username, vtext, msg.as_string())
  server.quit()
  </code></pre>