/** * Sends the message * * @return void * @throws FailedRecipientsException Is thrown if the * underlying messaging service returns one or more failed * recipients. */ public function send() { $acceptedRecipients = $this->message->send(); $noAcceptedRecipients = 0 === $acceptedRecipients; $hasFailedRecipients = count($this->message->getFailedRecipients()) > 0; if ($noAcceptedRecipients || $hasFailedRecipients) { $exc = new FailedRecipientsException(); $exc->setSenderList((array) $this->message->getSender()); $exc->setReceiverList($this->message->getTo()); $exc->setFailedRecipients($this->message->getFailedRecipients()); throw $exc; } }