protected function sendEmail(Swift_Transport $transport, SpoolEmailInterface $email, &$failedRecipients)
    {
        $count = 0;

        try {
            if ($transport->send($email->getMessage(), $failedRecipients)) {
                $email->setStatus(SpoolEmailStatus::STATUS_SUCCESS);
                ++$count;
            } else {
                $email->setStatus(SpoolEmailStatus::STATUS_FAILED);
            }
        } catch (\Swift_TransportException $e) {
            $email->setStatus(SpoolEmailStatus::STATUS_FAILED);
            $email->setStatusMessage($e->getMessage());
        }

        return $count;
    }