• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Issue My Mail API Script is not working for creating mail accounts.

I had working script written in PHP to create email account in plesk. I got that from
pmill/php-plesk

Script is below.
<?php

require_once("config.php");
//echo $_GET['r']."<br>";
$emilid=$_GET['email'];
$password=$_GET['password'];

$params = array(
'email'=>$emilid,
'password'=>$password,
);

$request = new \pmill\Plesk\CreateEmailAddress($config, $params);
$info = $request->process();

Now. This script does not work after my plesk was update to Version 17.8.11.

My Server details are
OS ‪CentOS Linux 7.5.1804 (Core)‬
Product Plesk Onyx
Version 17.8.11 Update #22, last updated on Sept 26, 2018 03:25 AM


Please help me how to fix this.
 
mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'pmill\\Plesk\\ApiRequestException' with message 'Error: Incorrect request parameters submitted' in /var/www/vhosts/../plesk/src/pmill/Plesk/BaseRequest.php:31, referer: https://../system-emailgateway-vcm-emails-new.php?id=88

mod_fcgid: stderr: Stack trace:, referer: https://../system-emailgateway-vcm-emails-new.php?id=88

mod_fcgid: stderr: #0 /var/www/vhosts/../plesk/src/pmill/Plesk/ListEmailAddresses.php(33): pmill\\Plesk\\BaseRequest->__construct(Array, Array), referer: https://../system-emailgateway-vcm-emails-new.php?id=88

mod_fcgid: stderr: #1 /var/www/vhosts/../plesk/examples/EmailAddresses/checkemail.php(8): pmill\\Plesk\\ListEmailAddresses->__construct(Array, Array), referer: https://../system-emailgateway-vcm-emails-new.php?id=88

mod_fcgid: stderr: #2 {main}, referer: https://../system-emailgateway-vcm-emails-new.php?id=88

mod_fcgid: stderr: thrown in /var/www/vhosts/../plesk/src/pmill/Plesk/BaseRequest.php on line 31, referer: https://../system-emailgateway-vcm-emails-new.php?id=88
 
What Plesk version did you update from? Just curious as this github project hasn't been updated in a few years by the looks of it.
 
Line 31 is
if (!$this->check_params()) {
throw new ApiRequestException("Error: Incorrect request parameters submitted");
}

I commented the line as
//throw new ApiRequestException("Error: Incorrect request parameters submitted");

Now
This error comes.

mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'pmill\\Plesk\\ApiRequestException' with message 'This feature is not supported for protocol version 1.6.3.5.' in /var/www/vhosts/../plesk/src/pmill/Plesk/CreateEmailAddress.php:60, referer: https://../system-emailgateway-vcm-emails-new.php?id=88

My Latest version is
Plesk Onyx
Version 17.8.11 Update #24, last updated on Oct 4, 2018 03:10 AM

It's just automate update. It comes and I says update.
 
Can't I change the version of API. It's not my fault, it's automated update.

If I cannot change the version, can you give me code samples. this documentation does not have a sample. It seems complex.
 
To confirm, you’re just looking for a quick example in PHP to make a proper API called to Plesk to create an email account?

I can get you something in a day or two if nobody beats me to it. I’m just too busy with other clients lately. I also haven’t worked with the Plesk API lately so I’m thinking my current examples wouldn’t function either.
 
Back
Top