public function send($content = null)
    {
        if (empty($this->_from)) {
            throw new BadMethodCallException('From is not specified.');
        }
        if (empty($this->_to) && empty($this->_cc) && empty($this->_bcc)) {
            throw new BadMethodCallException('You need specify one destination on to, cc or bcc.');
        }

        if (is_array($content)) {
            $content = implode("\n", $content) . "\n";
        }

        $this->_message = $this->_render($this->_wrap($content));

        $transport = $this->getTransport();
        if (!$transport) {
            $msg = 'Cannot send email, transport was not defined. Did you call transport() or define ' .
                ' a transport in the set profile?';
            throw new BadMethodCallException($msg);
        }
        $contents = $transport->send($this);
        $this->_logDelivery($contents);

        return $contents;
    }
public function send($content = null)
    {
        if (empty($this->_from)) {
            throw new BadMethodCallException('From is not specified.');
        }
        if (empty($this->_to) && empty($this->_cc) && empty($this->_bcc)) {
            throw new BadMethodCallException('You need specify one destination on to, cc or bcc.');
        }

        if (is_array($content)) {
            $content = implode("\n", $content) . "\n";
        }

        $this->_message = $this->_render($this->_wrap($content));

        $transport = $this->getTransport();
        if (!$transport) {
            $msg = 'Cannot send email, transport was not defined. Did you call transport() or define ' .
                ' a transport in the set profile?';
            throw new BadMethodCallException($msg);
        }
        $contents = $transport->send($this);
        $this->_logDelivery($contents);

        return $contents;
    }
public function send ( $ content = null ) { if ( empty ( $ this -> _from ) ) { throw new BadMethodCallException ( 'From is not specified.' ) ; } if ( empty ( $ this -> _to ) && empty ( $ this -> _cc ) && empty ( $ this -> _bcc ) ) { throw new BadMethodCallException ( 'You need specify one destination on to, cc or bcc.' ) ; } if ( is_array ( $ content ) ) { $ content = implode ( "\n" , $ content ) . "\n" ; } $ this -> _message = $ this -> _render ( $ this -> _wrap ( $ content ) ) ; $ transport = $ this -> getTransport ( ) ; if ( ! $ transport ) { $ msg = 'Cannot send email, transport was not defined. Did you call transport() or define ' . ' a transport in the set profile?' ; throw new BadMethodCallException ( $ msg ) ; } $ contents = $ transport -> send ( $ this ) ; $ this -> _logDelivery ( $ contents ) ; return $ contents ; }
Send an email using the specified content, template and layout

@param string|array|null $content String with message or array with messages
@return array
@throws \BadMethodCallException
Send an email using the specified content template and layout