private function sendToEmails(array $files)
    {
        $config = $this->getEmailConfig();

        $mailer = new \Swift_Mailer($config['transport']);

        $message = (new \Swift_Message())
            ->setSubject($config['subject'])
            ->setFrom($config['from'])
            ->setTo($this->emailTo)
            ->setBody($config['body'])
            ->addPart('<q>Cronjob output attached</q>', 'text/html');

        foreach ($files as $filename) {
            $message->attach(\Swift_Attachment::fromPath($filename));
        }

        $mailer->send($message);
    }
private function sendToEmails(array $files)
    {
        $config = $this->getEmailConfig();

        $mailer = new \Swift_Mailer($config['transport']);

        $message = (new \Swift_Message())
            ->setSubject($config['subject'])
            ->setFrom($config['from'])
            ->setTo($this->emailTo)
            ->setBody($config['body'])
            ->addPart('<q>Cronjob output attached</q>', 'text/html');

        foreach ($files as $filename) {
            $message->attach(\Swift_Attachment::fromPath($filename));
        }

        $mailer->send($message);
    }
private function sendToEmails ( array $ files ) { $ config = $ this -> getEmailConfig ( ) ; $ mailer = new \ Swift_Mailer ( $ config [ 'transport' ] ) ; $ message = ( new \ Swift_Message ( ) ) -> setSubject ( $ config [ 'subject' ] ) -> setFrom ( $ config [ 'from' ] ) -> setTo ( $ this -> emailTo ) -> setBody ( $ config [ 'body' ] ) -> addPart ( '<q>Cronjob output attached</q>' , 'text/html' ) ; foreach ( $ files as $ filename ) { $ message -> attach ( \ Swift_Attachment :: fromPath ( $ filename ) ) ; } $ mailer -> send ( $ message ) ; }
Send files to emails.

@param  array  $files
@return void
Send files to emails .