public function create($options = [])
    {
        if (isset($options['to'])) {
            $name = '';

            if (is_array($options['to'])) {
                if (isset($options['to'][1])) {
                    $name = $options['to'][1];
                }

                $this->setTo($options['to'][0], $name);
            } else {
                $this->setTo($options['to']);
            }
        }

        if (isset($options['from'])) {
            $name = '';

            if (is_array($options['from'])) {
                if (isset($options['from'][1])) {
                    $name = $options['from'][1];
                }

                $this->setFrom($options['from'][0], $name);
            } else {
                $this->setFrom($options['from']);
            }
        }

        if (isset($options['subject'])) {
            $this->addSubject($options['subject']);
        }

        return $this;
    }
public function create($options = [])
    {
        if (isset($options['to'])) {
            $name = '';

            if (is_array($options['to'])) {
                if (isset($options['to'][1])) {
                    $name = $options['to'][1];
                }

                $this->setTo($options['to'][0], $name);
            } else {
                $this->setTo($options['to']);
            }
        }

        if (isset($options['from'])) {
            $name = '';

            if (is_array($options['from'])) {
                if (isset($options['from'][1])) {
                    $name = $options['from'][1];
                }

                $this->setFrom($options['from'][0], $name);
            } else {
                $this->setFrom($options['from']);
            }
        }

        if (isset($options['subject'])) {
            $this->addSubject($options['subject']);
        }

        return $this;
    }
public function create ( $ options = [ ] ) { if ( isset ( $ options [ 'to' ] ) ) { $ name = '' ; if ( is_array ( $ options [ 'to' ] ) ) { if ( isset ( $ options [ 'to' ] [ 1 ] ) ) { $ name = $ options [ 'to' ] [ 1 ] ; } $ this -> setTo ( $ options [ 'to' ] [ 0 ] , $ name ) ; } else { $ this -> setTo ( $ options [ 'to' ] ) ; } } if ( isset ( $ options [ 'from' ] ) ) { $ name = '' ; if ( is_array ( $ options [ 'from' ] ) ) { if ( isset ( $ options [ 'from' ] [ 1 ] ) ) { $ name = $ options [ 'from' ] [ 1 ] ; } $ this -> setFrom ( $ options [ 'from' ] [ 0 ] , $ name ) ; } else { $ this -> setFrom ( $ options [ 'from' ] ) ; } } if ( isset ( $ options [ 'subject' ] ) ) { $ this -> addSubject ( $ options [ 'subject' ] ) ; } return $ this ; }
Creates the initial message. Takes in to, from and subject.

@param array $options

@return \Scara\Mail\Mailer
Creates the initial message . Takes in to from and subject .