I am using php-ews library(new version) to display the calendar events of the users in my project. The users can set their ms exchange account details in their profile and then use the calendar within my project itself. The code is like below
$host = '{host_set_on_users_profile}';
$username = '{username_set_on_users_profile}';
$password = '{password_set_on_users_profile}';
$version = Client::VERSION_2016;
$client = new Client($host, $username, $password, $version);
$client->setTimezone($timezone);
// Build request
$request = new FindItemType();
// more request building code here
$response = $client->FindItem($request);
But I am getting the below issue
[faultstring] => The specified server version is invalid.
The reason is I have used fixed VERSION_2016 and the users can have any version of ms exchange set up for the account.
So is there any way using which first I can find out the server version based on host,username and password? so that I can use the same for creating the client object