title: flask-mail TypeError: getaddrinfo() argument 1 must be string or None
body: <p>I want to use flask mail in my webapp and I am gettin error that I don't really understand. Been following guidelines and can't get it to work. In the following proccess I want app to send email to new registered user.</p>
  
  <p>Config:</p>
  
  <pre><code>MAIL_SERVER='smtp.gmail.com',
  MAIL_PORT=465,
  MAIL_USE_SSL=True,
  MAIL_USE_TLS=False,
  MAIL_USERNAME = 'myMail@gmail.com',
  MAIL_PASSWORD = '******'
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>from flask_mail import Mail, Message
  mail = Mail(app)
  
  
  @app.route("/send_mail/")
  def send_mail():
     msg = Message('Hello', sender = 'myMail@gmail.com', recipients = ['somebody@gmail.com'])
     msg.body = "This is the email body"
     mail.send(msg)
  </code></pre>
  
  <p>Error I am getting:</p>
  
  <pre><code>File "C:\venvs\test\lib\site-packages\flask\app.py", line 1994, in __call__
  return self.wsgi_app(environ, start_response)
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1985, in wsgi_app
  response = self.handle_exception(e)
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1540, in handle_exception
  reraise(exc_type, exc_value, tb)
  File "C:\venvs\test\lib\site-packages\flask\_compat.py", line 33, in reraise
  raise value
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1982, in wsgi_app
  response = self.full_dispatch_request()
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
  rv = self.handle_user_exception(e)
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
  reraise(exc_type, exc_value, tb)
  File "C:\venvs\test\lib\site-packages\flask\_compat.py", line 33, in reraise
  raise value
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
  rv = self.dispatch_request()
  File "C:\venvs\test\lib\site-packages\flask\app.py", line 1598, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\venvs\test\views.py", line 202, in send_mail
  mail.send(msg)
  File "C:\venvs\test\lib\site-packages\flask_mail.py", line 491, in send
  with self.connect() as connection:
  File "C:\venvs\test\lib\site-packages\flask_mail.py", line 144, in __enter__
  self.host = self.configure_host()
  File "C:\venvs\test\lib\site-packages\flask_mail.py", line 156, in configure_host
  host = smtplib.SMTP_SSL(self.mail.server, self.mail.port)
  File "C:\Python\lib\smtplib.py", line 1029, in __init__
  source_address)
  File "C:\Python\lib\smtplib.py", line 251, in __init__
  (code, msg) = self.connect(host, port)
  File "C:\Python\lib\smtplib.py", line 335, in connect
  self.sock = self._get_socket(host, port, self.timeout)
  File "C:\Python\lib\smtplib.py", line 1035, in _get_socket
  self.source_address)
  File "C:\Python\lib\socket.py", line 704, in create_connection
  for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "C:\Python\lib\socket.py", line 743, in getaddrinfo
  for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  TypeError: getaddrinfo() argument 1 must be string or None
  </code></pre>
  
  <p>Any ideas?</p>