title: Send anonymous mail from local machine
body: <p>I was using Python for sending an email using an external SMTP server. In the code below, I tried using <code>smtp.gmail.com</code> to send an email from a gmail id to some other id. I was able to produce the output with the code below.</p>
  
  <pre><code>import smtplib
  from email.MIMEText import MIMEText
  import socket
  
  
  socket.setdefaulttimeout(None)
  HOST = "smtp.gmail.com"
  PORT = "587"
  sender= "somemail@gmail.com"
  password = "pass"
  receiver= "receiver@somedomain.com"
  
  msg = MIMEText("Hello World")
  
  msg['Subject'] = 'Subject - Hello World'
  msg['From'] = sender
  msg['To'] = receiver
  
  server = smtplib.SMTP()
  server.connect(HOST, PORT)
  server.starttls()
  server.login(sender,password)
  server.sendmail(sender,receiver, msg.as_string())
  server.close()
  </code></pre>
  
  <p>But I have to do the same without the help of an external SMTP server. How can do the same with Python?
  <br />Please help.</p>