code: def send_queued(processes=1, log_level=None):
      
      queued_emails = get_queued()
      total_sent, total_failed = 0, 0
      total_email = len(queued_emails)
  
      logger.info('Started sending %s emails with %s processes.' %
                  (total_email, processes))
  
      if log_level is None:
          log_level = get_log_level()
  
      if queued_emails:
  
          # Don't use more processes than number of emails
          if total_email < processes:
              processes = total_email
  
          if processes == 1:
              total_sent, total_failed = _send_bulk(queued_emails,
                                                    uses_multiprocessing=False,
                                                    log_level=log_level)
          else:
              email_lists = split_emails(queued_emails, processes)
  
              pool = Pool(processes)
              results = pool.map(_send_bulk, email_lists)
              pool.terminate()
  
              total_sent = sum([result[0] for result in results])
              total_failed = sum([result[1] for result in results])
      message = '%s emails attempted, %s sent, %s failed' % (
          total_email,
          total_sent,
          total_failed
      )
      logger.info(message)
      return (total_sent, total_failed)
docs: Sends out all queued mails that has scheduled_time less than now or None