Bogardo\Mailgun\Validation\Validator::parse PHP Method

parse() public method

The parsed addresses are a list of addresses that are syntactically valid (and optionally have DNS and ESP specific grammar checks). The unparsable list is a list of characters sequences that the parser was not able to understand. These often align with invalid email addresses, but not always.
public parse ( array | string $addresses, boolean $syntaxOnly = false ) : mixed
$addresses array | string
$syntaxOnly boolean
return mixed
    public function parse($addresses, $syntaxOnly = false)
    {
        if (is_array($addresses)) {
            $addresses = implode(',', $addresses);
        }
        $syntaxOnly = $syntaxOnly ? 'true' : 'false';
        return $this->mailgun->get('address/parse', ['addresses' => $addresses, 'syntax_only' => $syntaxOnly])->http_response_body;
    }