title: Unable to send email from python
body: <p>I am using the following code to send email from python program in localhost,</p>
  
  <pre><code>import smtplib
  from email.mime.multipart import MIMEMultipart
  from email.mime.text import MIMEText
  
  me = "tonyr1291@gmail.com"
  you = "testaccount@gmail.com"
  
  
  msg = MIMEMultipart('alternative')
  msg['Subject'] = "Link"
  msg['From'] = me
  msg['To'] = you
  
  text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttp://www.python.org"
  html = """\
  &lt;html&gt;
    &lt;head&gt;&lt;/head&gt;
     &lt;body&gt;
      &lt;p&gt;Hi!&lt;br&gt;
         How are you?&lt;br&gt;
         Here is the &lt;a href="http://www.python.org"&gt;link&lt;/a&gt; you wanted.
      &lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  """
  
  part1 = MIMEText(text, 'plain')
  part2 = MIMEText(html, 'html')
  
  msg.attach(part1)
  msg.attach(part2)
  
  s = smtplib.SMTP('localhost',5000)
  s.sendmail(me, you, msg.as_string())
  s.quit()
  </code></pre>
  
  <p>This code is from python documentation.</p>
  
  <p>When I run this code, it is running continuously but no email is sent.</p>
  
  <p>I would like to know, do I have to make some other configurations anywhere else other than this code.</p>
  
  <p>I am not seeing any error.</p>
  
  <p>I am using <code>python 2.7</code></p>
  
  <p>This is given as a solution in <a href="https://stackoverflow.com/a/882770/5039470">Sending HTML email using Python</a></p>