parameters: (self, keyfile=None, certfile=None, callback=None)
docstring: Puts the connection to the SMTP server into TLS mode.
  
          If there has been no previous EHLO or HELO command this session, this
          method tries ESMTP EHLO first.
  
          If the server supports TLS, this will encrypt the rest of the SMTP
          session. If you provide the keyfile and certfile parameters,
          the identity of the SMTP server and client can be checked. This,
          however, depends on whether the socket module really checks the
          certificates.
  
          This method may raise the following exceptions:
  
           SMTPHeloError            The server didn't reply properly to
                                    the helo greeting.
docstring_summary: Puts the connection to the SMTP server into TLS mode.
docstring_tokens: Puts the connection to the SMTP server into TLS mode .
function: def starttls(self, keyfile=None, certfile=None, callback=None):
          """Puts the connection to the SMTP server into TLS mode.
  
          If there has been no previous EHLO or HELO command this session, this
          method tries ESMTP EHLO first.
  
          If the server supports TLS, this will encrypt the rest of the SMTP
          session. If you provide the keyfile and certfile parameters,
          the identity of the SMTP server and client can be checked. This,
          however, depends on whether the socket module really checks the
          certificates.
  
          This method may raise the following exceptions:
  
           SMTPHeloError            The server didn't reply properly to
                                    the helo greeting.
          """
          yield gen.Task(self.ehlo_or_helo_if_needed)
          if not self.has_extn("starttls"):
              raise SMTPException("STARTTLS extension not supported by server.")
          result = yield gen.Task(self.docmd, "STARTTLS")
          (resp, reply) = result.args
          if resp == 220:
              if not _have_ssl:
                  raise RuntimeError("No SSL support included in this Python")
              self.sock = yield gen.Task(
                  self._get_ssl_socket, self.sock,
                  keyfile=keyfile, certfile=certfile
              )
              # RFC 3207:
              # The client MUST discard any knowledge obtained from
              # the server, such as the list of SMTP service extensions,
              # which was not obtained from the TLS negotiation itself.
              self.helo_resp = None
              self.ehlo_resp = None
              self.esmtp_features = {}
              self.does_esmtp = 0
          if callback:
              callback(resp, reply)
function_tokens: def starttls ( self , keyfile = None , certfile = None , callback = None ) : yield gen . Task ( self . ehlo_or_helo_if_needed ) if not self . has_extn ( "starttls" ) : raise SMTPException ( "STARTTLS extension not supported by server." ) result = yield gen . Task ( self . docmd , "STARTTLS" ) ( resp , reply ) = result . args if resp == 220 : if not _have_ssl : raise RuntimeError ( "No SSL support included in this Python" ) self . sock = yield gen . Task ( self . _get_ssl_socket , self . sock , keyfile = keyfile , certfile = certfile ) # RFC 3207: # The client MUST discard any knowledge obtained from # the server, such as the list of SMTP service extensions, # which was not obtained from the TLS negotiation itself. self . helo_resp = None self . ehlo_resp = None self . esmtp_features = { } self . does_esmtp = 0 if callback : callback ( resp , reply )