Job/Mailer/Mailer.php
public function send(Message $message, LoggerInterface $logger)
    {
        $logger->debug('Send mail {message}', array('message' => $message));

        $mail = $this->mailer->createMessage()
            ->setSubject($message->getSubject())
            ->setFrom($message->getFrom())
            ->setTo($message->getTo());

        $mail->addPart($message->getMessage(), 'text/plain');

        try {
            $this->mailer->send($mail);

            $this->mailer->getTransport()->stop();
        } catch (\Exception $e) {
            $this->mailer->getTransport()->stop();

            throw $e;
        }
    }
public function send(Message $message, LoggerInterface $logger)
    {
        $logger->debug('Send mail {message}', array('message' => $message));

        $mail = $this->mailer->createMessage()
            ->setSubject($message->getSubject())
            ->setFrom($message->getFrom())
            ->setTo($message->getTo());

        $mail->addPart($message->getMessage(), 'text/plain');

        try {
            $this->mailer->send($mail);

            $this->mailer->getTransport()->stop();
        } catch (\Exception $e) {
            $this->mailer->getTransport()->stop();

            throw $e;
        }
    }
Sends a mail.

@ParamType("message", type="Abc\Bundle\JobBundle\Job\Mailer\Message")
@ParamType("logger", type="@abc.logger")

@param Message         $message
@param LoggerInterface $logger
@throws \Exception Rethrows exceptions thrown by mailer