original_string: public function sendMail(Form $form, Result $result)
      {
          $message = \Swift_Message::newInstance()
              ->setSubject($form->getMailSubject())
              ->setTo(array($form->getMailRecipientEmail() => $form->getMailRecipientName()))
              ->setBody($this->container->get('templating')->render('NetvliesFormBundle:Mail:result.html.twig', array(
                  'content' => $form->getMailBody(),
                  'entries' => $result->getEntries(),
              )), 'text/html');
  
          if ($form->getMailSenderName() != null && $form->getMailSenderEmail() != null) {
              $message->setFrom(array($form->getMailSenderEmail() => $form->getMailSenderName()));
          }
  
          $this->container->get('mailer')->send($message);
  
          $transport = $this->container->get('mailer')->getTransport();
          if (!$transport instanceof \Swift_Transport_SpoolTransport) {
              return;
          }
  
          $spool = $transport->getSpool();
          if (!$spool instanceof \Swift_MemorySpool) {
              return;
          }
  
          $spool->flushQueue($this->container->get('swiftmailer.transport.real'));
      }
code: public function sendMail(Form $form, Result $result)
      {
          $message = \Swift_Message::newInstance()
              ->setSubject($form->getMailSubject())
              ->setTo(array($form->getMailRecipientEmail() => $form->getMailRecipientName()))
              ->setBody($this->container->get('templating')->render('NetvliesFormBundle:Mail:result.html.twig', array(
                  'content' => $form->getMailBody(),
                  'entries' => $result->getEntries(),
              )), 'text/html');
  
          if ($form->getMailSenderName() != null && $form->getMailSenderEmail() != null) {
              $message->setFrom(array($form->getMailSenderEmail() => $form->getMailSenderName()));
          }
  
          $this->container->get('mailer')->send($message);
  
          $transport = $this->container->get('mailer')->getTransport();
          if (!$transport instanceof \Swift_Transport_SpoolTransport) {
              return;
          }
  
          $spool = $transport->getSpool();
          if (!$spool instanceof \Swift_MemorySpool) {
              return;
          }
  
          $spool->flushQueue($this->container->get('swiftmailer.transport.real'));
      }
code_tokens: public function sendMail ( Form $ form , Result $ result ) { $ message = \ Swift_Message :: newInstance ( ) -> setSubject ( $ form -> getMailSubject ( ) ) -> setTo ( array ( $ form -> getMailRecipientEmail ( ) => $ form -> getMailRecipientName ( ) ) ) -> setBody ( $ this -> container -> get ( 'templating' ) -> render ( 'NetvliesFormBundle:Mail:result.html.twig' , array ( 'content' => $ form -> getMailBody ( ) , 'entries' => $ result -> getEntries ( ) , ) ) , 'text/html' ) ; if ( $ form -> getMailSenderName ( ) != null && $ form -> getMailSenderEmail ( ) != null ) { $ message -> setFrom ( array ( $ form -> getMailSenderEmail ( ) => $ form -> getMailSenderName ( ) ) ) ; } $ this -> container -> get ( 'mailer' ) -> send ( $ message ) ; $ transport = $ this -> container -> get ( 'mailer' ) -> getTransport ( ) ; if ( ! $ transport instanceof \ Swift_Transport_SpoolTransport ) { return ; } $ spool = $ transport -> getSpool ( ) ; if ( ! $ spool instanceof \ Swift_MemorySpool ) { return ; } $ spool -> flushQueue ( $ this -> container -> get ( 'swiftmailer.transport.real' ) ) ; }
docstring: Sends a mail containing the form values to the contact e-mail address
  specified.
  
  @param Form   $form
  @param Result $result
docstring_tokens: Sends a mail containing the form values to the contact e - mail address specified .