title: Unable to send email from Python due to Address Family not supported Error
body: <p>I am geeting an error while I am trying to send an automated email from python. </p>
  
  <p>The error I am getting is "[Errno 97] Address family not supported by protocol"</p>
  
  <pre><code># import necessary packages
  from email.mime.multipart import MIMEMultipart
  from email.mime.text import MIMEText
  import smtplib
  
  # create message object instance
  msg = MIMEMultipart()
  password = "password"
  msg['From'] = "risk@gmail.com"
  msg['To'] = "game@gmail.com"
  msg['Subject'] = "Photos"
  
  # attach image to message body
  
  
  server = smtplib.SMTP('smtp.gmail.com: 587')
  
  server.starttls()
  
  # Login Credentials for sending the mail
  server.login(msg['From'], password)
  
  server.sendmail(msg['From'], msg['To'], msg.as_string())
  </code></pre>
  
  <p>How can I fix this problem. Any help is appreciated.</p>