private function sendMessage()
    {
        try {
            $this->mailer->send($this->message_layout->getViewLayout(), $this->message_layout->getMessageVariables(), function ($message) {

                if (config('pigeon.dev.override')) {
                    $message->to(config('pigeon.dev.override_email'));
                } else {
                    $message->to($this->to);
                }

                // Set message parts
                $message->subject($this->subject)
                    ->cc($this->cc)
                    ->bcc($this->bcc)
                    ->replyTo($this->reply_to)
                    ->sender($this->sender);

                if (!empty($this->from)) {
                    $message->from($this->from);
                }

                // Set all attachments
                foreach ($this->attachments as $a) {
                    $message->attach($a['path'], $a['options']);
                }
            });

        } catch (ErrorException $e) {
            $msg = 'Pigeon could not send message: ' . $e->getMessage();
            $this->logger->error($msg);
            return false;
        } catch (\Swift_TransportException $e) {
            $msg = 'SMTP failure: ' . $e->getMessage();
            $this->logger->error($msg);
            return false;
        }

        return true;
    }
private function sendMessage()
    {
        try {
            $this->mailer->send($this->message_layout->getViewLayout(), $this->message_layout->getMessageVariables(), function ($message) {

                if (config('pigeon.dev.override')) {
                    $message->to(config('pigeon.dev.override_email'));
                } else {
                    $message->to($this->to);
                }

                // Set message parts
                $message->subject($this->subject)
                    ->cc($this->cc)
                    ->bcc($this->bcc)
                    ->replyTo($this->reply_to)
                    ->sender($this->sender);

                if (!empty($this->from)) {
                    $message->from($this->from);
                }

                // Set all attachments
                foreach ($this->attachments as $a) {
                    $message->attach($a['path'], $a['options']);
                }
            });

        } catch (ErrorException $e) {
            $msg = 'Pigeon could not send message: ' . $e->getMessage();
            $this->logger->error($msg);
            return false;
        } catch (\Swift_TransportException $e) {
            $msg = 'SMTP failure: ' . $e->getMessage();
            $this->logger->error($msg);
            return false;
        }

        return true;
    }
private function sendMessage ( ) { try { $ this -> mailer -> send ( $ this -> message_layout -> getViewLayout ( ) , $ this -> message_layout -> getMessageVariables ( ) , function ( $ message ) { if ( config ( 'pigeon.dev.override' ) ) { $ message -> to ( config ( 'pigeon.dev.override_email' ) ) ; } else { $ message -> to ( $ this -> to ) ; } // Set message parts $ message -> subject ( $ this -> subject ) -> cc ( $ this -> cc ) -> bcc ( $ this -> bcc ) -> replyTo ( $ this -> reply_to ) -> sender ( $ this -> sender ) ; if ( ! empty ( $ this -> from ) ) { $ message -> from ( $ this -> from ) ; } // Set all attachments foreach ( $ this -> attachments as $ a ) { $ message -> attach ( $ a [ 'path' ] , $ a [ 'options' ] ) ; } } ) ; } catch ( ErrorException $ e ) { $ msg = 'Pigeon could not send message: ' . $ e -> getMessage ( ) ; $ this -> logger -> error ( $ msg ) ; return false ; } catch ( \ Swift_TransportException $ e ) { $ msg = 'SMTP failure: ' . $ e -> getMessage ( ) ; $ this -> logger -> error ( $ msg ) ; return false ; } return true ; }
Send Message with View

@return bool
Send Message with View