public function beforeSendPerformed(Swift_Events_SendEvent $event)
    {
        $message = $event->getMessage();

        $to = $this->filterEmailArray((array) $message->getTo());
        $cc = $this->filterEmailArray((array) $message->getCc());
        $bcc = $this->filterEmailArray((array) $message->getBcc());

        $message->setTo($to);
        $message->setCc($cc);
        $message->setBcc($bcc);

        $all = $to + $cc + $bcc;

        if (empty($all)) {
            $event->cancelBubble();
        }
    }
public function beforeSendPerformed(Swift_Events_SendEvent $event)
    {
        $message = $event->getMessage();

        $to = $this->filterEmailArray((array) $message->getTo());
        $cc = $this->filterEmailArray((array) $message->getCc());
        $bcc = $this->filterEmailArray((array) $message->getBcc());

        $message->setTo($to);
        $message->setCc($cc);
        $message->setBcc($bcc);

        $all = $to + $cc + $bcc;

        if (empty($all)) {
            $event->cancelBubble();
        }
    }
public function beforeSendPerformed ( Swift_Events_SendEvent $ event ) { $ message = $ event -> getMessage ( ) ; $ to = $ this -> filterEmailArray ( ( array ) $ message -> getTo ( ) ) ; $ cc = $ this -> filterEmailArray ( ( array ) $ message -> getCc ( ) ) ; $ bcc = $ this -> filterEmailArray ( ( array ) $ message -> getBcc ( ) ) ; $ message -> setTo ( $ to ) ; $ message -> setCc ( $ cc ) ; $ message -> setBcc ( $ bcc ) ; $ all = $ to + $ cc + $ bcc ; if ( empty ( $ all ) ) { $ event -> cancelBubble ( ) ; } }
Apply whitelist and blacklist to "to", "cc" and "bcc".

@param Swift_Events_SendEvent $event
Apply whitelist and blacklist to to cc and bcc .