code: async def sendmail(
          self, sender, recipients, message, mail_options=None, rcpt_options=None
      ):
          if isinstance(recipients, str):
              recipients = [recipients]
          if mail_options is None:
              mail_options = []
          if rcpt_options is None:
              rcpt_options = []
          await self.ehlo_or_helo_if_needed()
          if self.supports_esmtp:
              if "size" in self.esmtp_extensions:
                  mail_options.append("size={}".format(len(message)))
          await self.mail(sender, mail_options)
          errors = []
          for recipient in recipients:
              try:
                  await self.rcpt(recipient, rcpt_options)
              except SMTPCommandFailedError as e:
                  errors.append(e)
          if len(recipients) == len(errors):
              raise SMTPNoRecipientError(errors)
          await self.data(message)
          return errors