src/CarteBlanche/Controller/ErrorController.php
public function reportAction($code = null)
    {
        $referer = $this->getContainer()->get('router')->getReferer();
        $txt_message = $this->view(
            'error_mail_content',
            array(
                'url'=>$referer,
                'code'=>$code
            )
        );

        $webmaster_email = CarteBlanche::getConfig('app.webmaster_email', null);
        $webmaster_name = CarteBlanche::getConfig('app.webmaster_name', null);
        $mail = new \MimeEmail\Lib\MimeEmail();
        $mail
            ->setTo($webmaster_email, $webmaster_name)
            ->setSubject($this->trans('Error report'))
            ->setText($txt_message);
        $ok = $mail->send(true);
        if ($ok) {
            $this->getContainer()->get('session')
                ->setFlash("info:".$this->trans('OK - A report has been sent concerning your error. Thank you.'));
        } else {
            $this->getContainer()->get('session')
                ->setFlash("error:".$this->trans('ERROR - An error occurred while trying to send email ...'));
        }
        $this->getContainer()->get('router')->redirect($_SERVER['HTTP_REFERER']);
    }
public function reportAction($code = null)
    {
        $referer = $this->getContainer()->get('router')->getReferer();
        $txt_message = $this->view(
            'error_mail_content',
            array(
                'url'=>$referer,
                'code'=>$code
            )
        );

        $webmaster_email = CarteBlanche::getConfig('app.webmaster_email', null);
        $webmaster_name = CarteBlanche::getConfig('app.webmaster_name', null);
        $mail = new \MimeEmail\Lib\MimeEmail();
        $mail
            ->setTo($webmaster_email, $webmaster_name)
            ->setSubject($this->trans('Error report'))
            ->setText($txt_message);
        $ok = $mail->send(true);
        if ($ok) {
            $this->getContainer()->get('session')
                ->setFlash("info:".$this->trans('OK - A report has been sent concerning your error. Thank you.'));
        } else {
            $this->getContainer()->get('session')
                ->setFlash("error:".$this->trans('ERROR - An error occurred while trying to send email ...'));
        }
        $this->getContainer()->get('router')->redirect($_SERVER['HTTP_REFERER']);
    }
Send a mail report to the website contact