The Gmail API can only take one address at a time, let's get the very first one.

@param array $fromArray

@return string
480732
private function fromArrayToString(array $fromArray): string
    {
        // $fromArray = [ 'john.doe@example.com' => 'John Doe', 'jane.doe@example.com' => 'Jane Doe' ]; // sample
        if (count($fromArray) > 0) {
            reset($fromArray);
            $fromString = key($fromArray);

            return $fromString;
        }

        throw new \InvalidArgumentException('Set at least one \'from\' address when using '.self::class);
    }
301434
public static function fromAddressesArray($addresses)
    {
        ArgumentArrayValidator::validate($addresses, 'addresses');
        $addressList = new self();
        $addressList->setAddresses($addresses);
        return $addressList;
    }
1210529
public function fromArray(array $data = [])
    {
        if (isset($data['providerName'])) {
            $this->providerName = $data['providerName'];
        }
        if (isset($data['query'])) {
            $this->query = $data['query'];
        }
        if (isset($data['exception'])) {
            $this->exception = $data['exception'];
        }

        //GeoCoder Address::createFromArray expects longitude/latitude keys
        $data['address']['longitude'] = $data['address']['coordinates']['longitude'] ?? null;
        $data['address']['latitude'] = $data['address']['coordinates']['latitude'] ?? null;

        // Shortcut to create the address and set it in this class
        $this->setAddress(Address::createFromArray($data['address']));
    }
1239480
protected function relativeUrl($from='', $to='')
    {
        $from = explode('/', ltrim($from, '/'));
        $to   = explode('/', ltrim($to, '/'));
        $last = false;
        while (count($from) && count($to) && $from[0] === $to[0]) {
            $last = array_shift($from);
            array_shift($to);
        }
        if (count($from) == 0) {
            if ($last) array_unshift($to, $last);
            return './' . implode('/', $to);
        }
        else {
            return './' . str_repeat('../', count($from)-1) . implode('/', $to);
        }
    }
18349
public function indexOf($searchElement, $fromIndex = 0)
    {
        $result = array_search($searchElement, $this->getArrayCopy(), true);

        return $result === false ? -1 : $result + $fromIndex;

        // if ($fromIndex < 0) {
        //     $fromIndex = $this->length() + $fromIndex;
        // }
        // $result = array_search($searchElement, $this->slice($fromIndex)->getArrayCopy(), true);

        // return $result === false ? -1 : $result + $fromIndex;
    }
1296615
public function copyFromArray(array &$array)
    {
        // formatted
        $this->setFormatted(
            LanguageUtility::getFromArray('formatted', $array));

        // street_address
        $this->setStreetAddress(
            LanguageUtility::getFromArray('street_address', $array));

        // locality
        $this->setLocality(
            LanguageUtility::getFromArray('locality', $array));

        // region
        $this->setRegion(
            LanguageUtility::getFromArray('region', $array));

        // postal_code
        $this->setPostalCode(
            LanguageUtility::getFromArray('postal_code', $array));

        // country
        $this->setCountry(
            LanguageUtility::getFromArray('country', $array));
    }
467192
public static function arrayToList(array $array = array())
    {
        $return = array();
        foreach ($array as $name => $email) {
            $return[] = empty($name) || General::intval($name) > -1
                        ? $email
                        : $name . ' <' . $email . '>';
        }

        return implode(', ', $return);
    }
763945
public function from($from)
    {
        if (!$from) {
            return $this;
        }

        $this->from = $from;
        $this->request->from($from);

        return $this;
    }
766807
private function fromArrayToFailedRecipients(array $fromArray): array
    {
        if (count($fromArray) > 0) {
            reset($fromArray);
            $keyOfFirstElement = key($fromArray); // john_doe@example.com
            unset($fromArray[$keyOfFirstElement]);

            return $fromArray;
        }

        return [];
    }
338184
public static function fromArray(array $array)
    {
        $hostname       = $array['hostname'] ?? null;
        $challengeTs    = $array['challenge_ts'] ?? null;
        $apkPackageName = $array['apk_package_name'] ?? null;
        $score          = isset($array['score']) ? floatval($array['score']) : null;
        $action         = $array['action'] ?? null;

        if (isset($array['success']) && $array['success'] == true)
            return new static(true, [], $hostname, $challengeTs, $apkPackageName, $score, $action);

        if ( ! (isset($array['error-codes']) && is_array($array['error-codes'])))
            $array['error-codes'] = [ResponseV3::E_UNKNOWN_ERROR];

        return new static(false, $array['error-codes'], $hostname, $challengeTs, $apkPackageName, $score, $action);
    }
880518
private function decodeEmailAddresses(array $addresses): array
    {
        $return = [];
        foreach ($addresses as $address) {
            if (isset($address->mailbox)) {
                $return[] = $this->decodeEmailAddress($address);
            }
        }

        return $return;
    }
614089
protected static function clientIdArrayToAddressArray(array $client_id_array)
    {
        $address_connection_array = array();
        foreach ($client_id_array as $client_id) {
            $address_data = Context::clientIdToAddress($client_id);
            if ($address_data) {
                $address                                                            = long2ip($address_data['local_ip']) .
                    ":{$address_data['local_port']}";
                $address_connection_array[$address][$address_data['connection_id']] = $address_data['connection_id'];
            }
        }
        return $address_connection_array;
    }
411144
protected function address(array $array)
    {
        $address = new Address();
        if ($array) {
            foreach ($array as $k => $v) {
                if (array_key_exists($k, $address) && (strlen($v))) {
                    $address->$k = $v;
                }
            }
        }
        return new \SoapVar($address, SOAP_ENC_OBJECT, self::SOAP_ADDRESS, self::PAYLINE_NAMESPACE);
    }
1040187
public function fromArray($array) {
		$array=parent::fromArray($array);
		foreach ( $array as $key => $value ) {
			$this->setProperty($key, $value);
		}
		return $array;
	}
342221
private function getAllEmailAddresses($parts, $fields = ['to', 'from', 'cc', 'bcc'])
    {
        $addresses = [];
        foreach ($fields as $field) {
            $addressesPerField = [];
            foreach ($parts as $part) {
                 $addressesPerField = array_merge(
                     $addressesPerField,
                     $this->getAddressesFromFieldInPart($field, $part)
                 );
            }
            $addresses[$field] = $addressesPerField;
        }

        return $addresses;
    }
488609
public function renameMailbox($from = '', $to = '')
    {
        if (empty($from) || empty($to)) {
            return false;
        }

        $from = imap_utf7_encode($from);
        $to = imap_utf7_encode($to);

        return imap_renamemailbox($this->conn, "{".$this->settings['server']."}INBOX.".$from,
            "{".$this->settings['server']."}INBOX.".$to);
    }
1188360
public static function rangeFromBoundaries($from, $to)
    {
        $result = null;
        $invalid = false;
        foreach (array('from', 'to') as $param) {
            if (!($$param instanceof AddressInterface)) {
                $$param = (string) $$param;
                if ($$param === '') {
                    $$param = null;
                } else {
                    $$param = static::addressFromString($$param);
                    if ($$param === null) {
                        $invalid = true;
                    }
                }
            }
        }
        if ($invalid === false) {
            $result = static::rangeFromBoundaryAddresses($from, $to);
        }

        return $result;
    }