title: Python Email Module Does Not Work
body: <p>I am just trying the email module, and I cannot get even the simplest part of it to work! I am using the first example from the email module docs, <a href="https://docs.python.org/3/library/email-examples.html" rel="nofollow noreferrer">here</a>. When I run this program:</p>
  
  <pre><code># Import smtplib for the actual sending function
  import smtplib
  
  # Import the email modules we'll need
  from email.mime.text import MIMEText
  
  # Open a plain text file for reading.  For this example, assume that
  # the text file contains only ASCII characters.
  with open('email.txt') as fp:
      # Create a text/plain message
      msg = MIMEText(fp.read())
  
  # me == the sender's email address
  # you == the recipient's email address
  msg['Subject'] = 'Subject'
  msg['From'] = 'user@example.com'
  msg['To'] = 'otheruser@example.com'
  
  # Send the message via our own SMTP server.
  s = smtplib.SMTP('localhost')
  s.send_message(msg)
  s.quit()
  </code></pre>
  
  <p>I get this error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/User/emailTest.py", line 20, in &lt;module&gt;
      s = smtplib.SMTP('localhost')
    File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 251, in __init__
      (code, msg) = self.connect(host, port)
    File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 335, in connect
      self.sock = self._get_socket(host, port, self.timeout)
    File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 306, in _get_socket
      self.source_address)
    File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\socket.py", line 711, in create_connection
      raise err
    File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\socket.py", line 702, in create_connection
      sock.connect(sa)
  ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
  </code></pre>