src/Notify/Email.php
public function send($subject, $content, $to, $fromName = '', $fromEmail = '')
    {
        $mail      = new CakeEmail();
        $fromName  = ($fromName !== '') ? $fromName : $this->_fromName;
        $fromEmail = ($fromEmail !== '') ? $fromEmail : $this->_fromEmail;
        $transport = new MailTransport();

        return $mail
            ->setTransport($transport)
            ->setTemplate($this->_tpl)
            ->setEmailFormat($this->_format)
            ->setFrom($fromEmail, $fromName)
            ->setTo($to)
            ->setSubject($subject)
            ->setViewVars(['page_title' => $subject])
            ->send($content);
    }
public function send($subject, $content, $to, $fromName = '', $fromEmail = '')
    {
        $mail      = new CakeEmail();
        $fromName  = ($fromName !== '') ? $fromName : $this->_fromName;
        $fromEmail = ($fromEmail !== '') ? $fromEmail : $this->_fromEmail;
        $transport = new MailTransport();

        return $mail
            ->setTransport($transport)
            ->setTemplate($this->_tpl)
            ->setEmailFormat($this->_format)
            ->setFrom($fromEmail, $fromName)
            ->setTo($to)
            ->setSubject($subject)
            ->setViewVars(['page_title' => $subject])
            ->send($content);
    }
public function send ( $ subject , $ content , $ to , $ fromName = '' , $ fromEmail = '' ) { $ mail = new CakeEmail ( ) ; $ fromName = ( $ fromName !== '' ) ? $ fromName : $ this -> _fromName ; $ fromEmail = ( $ fromEmail !== '' ) ? $ fromEmail : $ this -> _fromEmail ; $ transport = new MailTransport ( ) ; return $ mail -> setTransport ( $ transport ) -> setTemplate ( $ this -> _tpl ) -> setEmailFormat ( $ this -> _format ) -> setFrom ( $ fromEmail , $ fromName ) -> setTo ( $ to ) -> setSubject ( $ subject ) -> setViewVars ( [ 'page_title' => $ subject ] ) -> send ( $ content ) ; }
Send message method.

@param   string $subject
@param   string $content
@param   string|array $to
@param   string $fromName
@param   string $fromEmail
@return  array
Send message method .