title: Embed picture in email
body: <p>I currently have a program that will randomly select quotes from a list and email them. I'm now trying to embed an image in the email as well. I've come across a problem where I can attach the email but my quotes no longer work. I have researched online and the solutions are not working for me. Note that I am using Python 3.2.2. </p>
  
  <p>Any guidance would be appreciated.</p>
  
  <pre><code>import smtplib
  from email.mime.multipart import MIMEMultipart
  from email.mime.image import MIMEImage
  
  attachment = 'bob.jpg' 
  
  msg = MIMEMultipart()
  msg["To"] = to_addr
  msg["From"] = from_addr
  msg["Subject"] = subject_header
  
  #msgText = MIMEText(&lt;b&gt;%s&lt;/b&gt;&lt;br&gt;&lt;img src="cid:bob.jpg"&gt;&lt;br&gt;, 'html') % body
  
  fp = open(attachment, 'rb')
  img = MIMEImage(fp.read())
  fp.close()
  
  msg.attach(img)
  
  #email_message = '%s\n%s\n%s' % (subject_header, body, img)
  email_message = '%s\n%s' % (subject_header, body)
  
  emailRezi = smtplib.SMTP(mail_server, mail_server_port)
  emailRezi.set_debuglevel(1)
  emailRezi.login(mail_username, mail_password)
  emailRezi.sendmail(from_addr, to_addr, email_message)
  #emailRezi.sendmail(from_addr, to_addr, msg.as_string())
  emailRezi.quit()
  </code></pre>
  
  <p>As you can tell from the code above I've tried different ways (referencing the #)</p>