<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def sendmail( self, sender, recipients, message, mail_options=None, rcpt_options=None ):
 """ Performs an entire e-mail transaction. Example: Result: {}. Args: sender (str):
 E-mail address of the sender. recipients (list of str or str):
 E-mail(s) address(es) of the recipient(s). message (str or bytes):
 Message body. mail_options (list of str):
 ESMTP options (such as *8BITMIME*) to send along the *MAIL* command. rcpt_options (list of str):
 ESMTP options (such as *DSN*) to send along all the *RCPT* commands. Raises: ConnectionResetError: If the connection with the server is unexpectedely lost. SMTPCommandFailedError: If the server refuses our EHLO/HELO greeting. SMTPCommandFailedError: If the server refuses our MAIL command. SMTPCommandFailedError: If the server refuses our DATA command. SMTPNoRecipientError: If the server refuses all given recipients. Returns: dict: A dict containing an entry for each recipient that was refused. Each entry is associated with a (code, message) 2-tuple containing the error code and message, as returned by the server. When everythign runs smoothly, the returning dict is empty. .. note:: The connection remains open after. It's your responsibility to close it. A good practice is to use the asynchronous context manager instead. See :meth:`SMTP.__aenter__` for further details. """

        # Make sure `recipients` is a list:
        if isinstance(recipients, str):
            recipients = [recipients]

        # Set some defaults values:
        if mail_options is None:
            mail_options = []

        if rcpt_options is None:
            rcpt_options = []

        # EHLO or HELO is required:
        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):
            # The server refused all our recipients:
            raise SMTPNoRecipientError(errors)

        await self.data(message)

        # If we got here then somebody got our mail:
        return errors