title: I'm trying to send an email from Django using Gmail SMTP
body: <p>I've set insecure source ON in my account's setting. Also, this is my settings.py file. Can anybody help me?</p>
  <pre><code>EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  EMAIL_HOST = 'smtp.gmail.com '
  EMAIL_USE_TLS = True
  EMAIL_PORT = 587
  EMAIL_HOST_USER =' my email'
  EMAIL_HOST_PASSWORD = 'my password'
  </code></pre>
  <p>and I'm getting this error in terminal when I write this code</p>
  <pre><code>PS D:\start here\silicium7\config-project&gt; python manage.py sendtestemail atabarzega79@gmail.com 
  Traceback (most recent call last):
   File &quot;manage.py&quot;, line 22, in &lt;module&gt;
     main()
   File &quot;manage.py&quot;, line 18, in main
     execute_from_command_line(sys.argv)
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\management\__init__.py&quot;, line 401, in execute_from_command_line
     utility.execute()
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\management\__init__.py&quot;, line 395, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\management\base.py&quot;, line 330, in run_from_argv
     self.execute(*args, **cmd_options)
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\management\base.py&quot;, line 371, in execute
     output = self.handle(*args, **options)
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\management\commands\sendtestemail.py&quot;, line 33, in handle
     recipient_list=kwargs['email'],
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\mail\__init__.py&quot;, line 61, in send_mail
     return mail.send()
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\mail\message.py&quot;, line 284, in send
     return self.get_connection(fail_silently).send_messages([self])
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\mail\backends\smtp.py&quot;, line 102, in send_messages
     new_conn_created = self.open()
   File &quot;D:\start here\silicium7\lib\site-packages\django\core\mail\backends\smtp.py&quot;, line 62, in open
     self.connection = self.connection_class(self.host, self.port, **connection_params)
   File &quot;C:\Users\Ata Barzegar\AppData\Local\Programs\Python\Python37\lib\smtplib.py&quot;, line 251, in __init__
     (code, msg) = self.connect(host, port)
   File &quot;C:\Users\Ata Barzegar\AppData\Local\Programs\Python\Python37\lib\smtplib.py&quot;, line 336, in connect
     self.sock = self._get_socket(host, port, self.timeout)
   File &quot;C:\Users\Ata Barzegar\AppData\Local\Programs\Python\Python37\lib\smtplib.py&quot;, line 307, in _get_socket
     self.source_address)
     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
   File &quot;C:\Users\Ata Barzegar\AppData\Local\Programs\Python\Python37\lib\socket.py&quot;, line 752, in getaddrinfo
     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  socket.gaierror: [Errno 11001] getaddrinfo failed
  </code></pre>