code: async def send_mail(self, mail):
          
          cmdlist = split_commandstring(self.cmd)
  
          try:
              # make sure self.mail is a string
              out, err, code = await call_cmd_async(cmdlist, stdin=str(mail))
              if code != 0:
                  msg = 'The sendmail command {} returned with code {}{}'.format(
                      self.cmd, code, ':\n' + err.strip() if err else '.')
                  raise Exception(msg)
          except Exception as e:
              logging.error(str(e))
              raise SendingMailFailed(str(e))
          logging.info('sent mail successfully')
          logging.info(out)
docs: Pipe the given mail to the configured sendmail command.  Display a
          short message on success or a notification on error.
          :param mail: the mail to send out
          :type mail: :class:`email.message.Message` or string
          :raises: class:`SendingMailFailed` if sending failes