code: def send(self, sender, to, subject, plain=None, html=None, cc=None, bcc=None,
               replyto=None, attach=None):
          
          self.sanity_check(sender, to, subject, plain=plain, html=html)
          # Create message container - the correct MIME type is multipart/alternative.
          msg = MIMEMultipart('mixed')
          msg['Subject'] = u(subject)
          msg['From']    = u(sender)
          msg['To']      = self.tolist(to)
          if cc:
              msg['Cc']      = self.tolist(cc)
  
          recipients = _stringlist(to, cc, bcc)
  
          if replyto:
              msg.add_header('reply-to', replyto)
  
          # Attach parts into message container.
          # According to RFC 2046, the last part of a multipart message, in this case
          # the HTML message, is best and preferred.
          if plain:
              msg.attach(MIMEText(u(plain), 'plain'))
          if html:
              msg.attach(MIMEText(u(html), 'html'))
  
          # Deal with attachments.
          if attach:
              for p in _stringlist(attach):
                  msg.attach(Attachment(p).as_msg())
  
          self.deliver(msg, recipients)
docs: Send the message.
  
          If we have PLAIN and HTML versions, send a multipart alternative
          MIME message, else send whichever we do have.
  
          If we have neither, raise NoContentError
  
          Arguments:
          - `sender`: str
          - `to`: list
          - `subject`: str
          - `plain`: str
          - `html`: str
          - `cc`: str or [str]
          - `bcc`: str or [str]
          - `replyto`: str
          - `attach`: str or [str]
  
          Return: None
          Exceptions: NoContentError