docs: def to_mime_message(self):
          """Returns the envelope as
          :py:class:`email.mime.multipart.MIMEMultipart`."""
          msg = MIMEMultipart('alternative')
          msg['Subject'] = self._header(self._subject or '')
  
          msg['From'] = self._encoded(self._addrs_to_header([self._from]))
          msg['To'] = self._encoded(self._addrs_to_header(self._to))
  
          if self._cc:
              msg['CC'] = self._addrs_to_header(self._cc)
  
          if self._headers:
              for key, value in self._headers.items():
                  msg[key] = self._header(value)
  
          for part in self._parts:
              type_maj, type_min = part[0].split('/')
              if type_maj == 'text' and type_min in ('html', 'plain'):
                  msg.attach(MIMEText(part[1], type_min, self._charset))
              else:
                  msg.attach(part[1])
  
          return msg