parameters: (self, host='', port=0, local_hostname=None,
                   timeout=socket._GLOBAL_DEFAULT_TIMEOUT)
docstring: Initialize a new instance.
  
          If specified, `host' is the name of the remote host to which to
          connect.  If specified, `port' specifies the port to which to connect.
          By default, smtplib.SMTP_PORT is used.  An SMTPConnectError is raised
          if the specified `host' doesn't respond correctly.  If specified,
          `local_hostname` is used as the FQDN of the local host.  By default,
          the local hostname is found using socket.getfqdn().
docstring_summary: Initialize a new instance.
docstring_tokens: Initialize a new instance .
function: def __init__(self, host='', port=0, local_hostname=None,
                   timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
          """Initialize a new instance.
  
          If specified, `host' is the name of the remote host to which to
          connect.  If specified, `port' specifies the port to which to connect.
          By default, smtplib.SMTP_PORT is used.  An SMTPConnectError is raised
          if the specified `host' doesn't respond correctly.  If specified,
          `local_hostname` is used as the FQDN of the local host.  By default,
          the local hostname is found using socket.getfqdn().
  
          """
          self.timeout = timeout
          self.esmtp_features = {}
          self.default_port = SMTP_PORT
          if host:
              (code, msg) = self.connect(host, port)
              if code != 220:
                  raise SMTPConnectError(code, msg)
          if local_hostname is not None:
              self.local_hostname = local_hostname
          else:
              # RFC 2821 says we should use the fqdn in the EHLO/HELO verb, and
              # if that can't be calculated, that we should use a domain literal
              # instead (essentially an encoded IP address like [A.B.C.D]).
              fqdn = socket.getfqdn()
              if '.' in fqdn:
                  self.local_hostname = fqdn
              else:
                  # We can't find an fqdn hostname, so use a domain literal
                  addr = '127.0.0.1'
                  try:
                      addr = socket.gethostbyname(socket.gethostname())
                  except socket.gaierror:
                      pass
                  self.local_hostname = '[%s]' % addr
function_tokens: def __init__ ( self , host = '' , port = 0 , local_hostname = None , timeout = socket . _GLOBAL_DEFAULT_TIMEOUT ) : self . timeout = timeout self . esmtp_features = { } self . default_port = SMTP_PORT if host : ( code , msg ) = self . connect ( host , port ) if code != 220 : raise SMTPConnectError ( code , msg ) if local_hostname is not None : self . local_hostname = local_hostname else : # RFC 2821 says we should use the fqdn in the EHLO/HELO verb, and # if that can't be calculated, that we should use a domain literal # instead (essentially an encoded IP address like [A.B.C.D]). fqdn = socket . getfqdn ( ) if '.' in fqdn : self . local_hostname = fqdn else : # We can't find an fqdn hostname, so use a domain literal addr = '127.0.0.1' try : addr = socket . gethostbyname ( socket . gethostname ( ) ) except socket . gaierror : pass self . local_hostname = '[%s]' % addr