• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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