I want to create email account in cpanel by php scripts. I am using this following code:
<?php
include("xmlapi.php"); //XMLAPI cpanel client class
$ip = "XXX.XX.XXX.XXX"; // should be server IP address or 127.0.0.1 if local server
$account = "XXXXX"; // cpanel user account name
$passwd ="L97$41lw"; // cpanel user password
$port =2083; // cpanel secure authentication port unsecure port# 2082
$email_domain ="mywebsite.com";
$email_user ="john";
$email_pass ="johnspassword";
$email_quota = 0; // 0 is no quota, or set a number in mb
$xmlapi = new xmlapi($ip);
$xmlapi->set_port($port); //set port number.
$xmlapi->password_auth($account, $passwd);
$xmlapi->set_debug(0); //output to error file set to 1 to see error_log.
$call = array(domain=>$email_domain, email=>$email_user, password=>$email_pass, quota=>$email_quota);
$result = $xmlapi->api2_query($account, "Email", "addpop", $call );
echo '123';
echo $result;
?>
My xml.api link is http://mywebsite.com/xmlapi.php. When i am executing the code no error is showing also not getting any value as $result