private function formatEmail($email, $name = null)
    {
        /**
         * Organization of the list of senders
         */
        if (!is_string($name) && preg_match('/^(.+)\s+<(.*)>\z$/', $email, $matches)) {
            array_shift($matches);
            $name = $matches[0];
            $email = $matches[1];
        }

        if (!Str::isMail($email)) {
            throw new \InvalidArgumentException("$email is not valid email.", E_USER_ERROR);
        }

        return [$name, $email];
    }
private function formatEmail($email, $name = null)
    {
        /**
         * Organization of the list of senders
         */
        if (!is_string($name) && preg_match('/^(.+)\s+<(.*)>\z$/', $email, $matches)) {
            array_shift($matches);
            $name = $matches[0];
            $email = $matches[1];
        }

        if (!Str::isMail($email)) {
            throw new \InvalidArgumentException("$email is not valid email.", E_USER_ERROR);
        }

        return [$name, $email];
    }
private function formatEmail ( $ email , $ name = null ) { /**
         * Organization of the list of senders
         */ if ( ! is_string ( $ name ) && preg_match ( '/^(.+)\s+<(.*)>\z$/' , $ email , $ matches ) ) { array_shift ( $ matches ) ; $ name = $ matches [ 0 ] ; $ email = $ matches [ 1 ] ; } if ( ! Str :: isMail ( $ email ) ) { throw new \ InvalidArgumentException ( "$email is not valid email." , E_USER_ERROR ) ; } return [ $ name , $ email ] ; }
Format the email receiver

@param string $email
@param string $name

@return array
Format the email receiver