docs: async def starttls(
          self,
          server_hostname: str = None,
          validate_certs: bool = None,
          client_cert: DefaultStrType = _default,
          client_key: DefaultStrType = _default,
          cert_bundle: DefaultStrType = _default,
          tls_context: DefaultSSLContextType = _default,
          timeout: DefaultNumType = _default,
      ) -> SMTPResponse:
          """
          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 (if
          validate_certs is True). You can also provide a custom SSLContext
          object. If no certs or SSLContext is given, and TLS config was
          provided when initializing the class, STARTTLS will use to that,
          otherwise it will use the Python defaults.
  
          :raises SMTPException: server does not support STARTTLS
          :raises SMTPServerDisconnected: connection lost
          :raises ValueError: invalid options provided
          """
          self._raise_error_if_disconnected()
          await self._ehlo_or_helo_if_needed()
  
          if validate_certs is not None:
              self.validate_certs = validate_certs
          if timeout is _default:
              timeout = self.timeout  # type: ignore
          if client_cert is not _default:
              self.client_cert = client_cert  # type: ignore
          if client_key is not _default:
              self.client_key = client_key  # type: ignore
          if cert_bundle is not _default:
              self.cert_bundle = cert_bundle  # type: ignore
          if tls_context is not _default:
              self.tls_context = tls_context  # type: ignore
  
          if self.tls_context is not None and self.client_cert is not None:
              raise ValueError(
                  "Either a TLS context or a certificate/key must be provided"
              )
  
          if server_hostname is None:
              server_hostname = self.hostname
  
          tls_context = self._get_tls_context()
  
          if not self.supports_extension("starttls"):
              raise SMTPException("SMTP STARTTLS extension not supported by server.")
  
          async with self._command_lock:
              try:
                  response, protocol = await self.protocol.starttls(  # type: ignore
                      tls_context, server_hostname=server_hostname, timeout=timeout
                  )
              except SMTPServerDisconnected:
                  self.close()
                  raise
  
          self.transport = protocol._app_transport
  
          # RFC 3207 part 4.2:
          # 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._reset_server_state()
  
          return response