src/Mail/Mail.php
public static function send($params)
    {
        $params = array_merge([
            'subject'  => '',
            'view'     => '',
            'body'     => '',
            'bodyHtml' => '',
            'to'       => [],
            'bcc'      => [],
            'cc'       => [],
            'replyTo'  => [],
            'file'     => '',
        ], $params);

        $message = (new static())->to($params['to'])->from($params['from'])
            ->subject($params['subject'])->bcc($params['bcc'])->cc($params['cc'])
            ->reply($params['replyTo']);

        if ($params['view'] != '') {
            $message->body(makeMail($params['view'], ['data' => $params['body']]), 'text/html');
        } else {
            $message->body($params['body']);
        }

        if ($params['file'] != '') {
            $message->attachment($params['file']);
        }

        return self::getMailerClient()->send($message);
    }
public static function send($params)
    {
        $params = array_merge([
            'subject'  => '',
            'view'     => '',
            'body'     => '',
            'bodyHtml' => '',
            'to'       => [],
            'bcc'      => [],
            'cc'       => [],
            'replyTo'  => [],
            'file'     => '',
        ], $params);

        $message = (new static())->to($params['to'])->from($params['from'])
            ->subject($params['subject'])->bcc($params['bcc'])->cc($params['cc'])
            ->reply($params['replyTo']);

        if ($params['view'] != '') {
            $message->body(makeMail($params['view'], ['data' => $params['body']]), 'text/html');
        } else {
            $message->body($params['body']);
        }

        if ($params['file'] != '') {
            $message->attachment($params['file']);
        }

        return self::getMailerClient()->send($message);
    }
public static function send ( $ params ) { $ params = array_merge ( [ 'subject' => '' , 'view' => '' , 'body' => '' , 'bodyHtml' => '' , 'to' => [ ] , 'bcc' => [ ] , 'cc' => [ ] , 'replyTo' => [ ] , 'file' => '' , ] , $ params ) ; $ message = ( new static ( ) ) -> to ( $ params [ 'to' ] ) -> from ( $ params [ 'from' ] ) -> subject ( $ params [ 'subject' ] ) -> bcc ( $ params [ 'bcc' ] ) -> cc ( $ params [ 'cc' ] ) -> reply ( $ params [ 'replyTo' ] ) ; if ( $ params [ 'view' ] != '' ) { $ message -> body ( makeMail ( $ params [ 'view' ] , [ 'data' => $ params [ 'body' ] ] ) , 'text/html' ) ; } else { $ message -> body ( $ params [ 'body' ] ) ; } if ( $ params [ 'file' ] != '' ) { $ message -> attachment ( $ params [ 'file' ] ) ; } return self :: getMailerClient ( ) -> send ( $ message ) ; }
Send message using chosen driver.

@param $params

@return int|mixed
Send message using chosen driver .