hmm well i found 2 errors ... cpanel?user='.$cpusername.'
and i was also using ***@***.*** for the username when you said to use only the part before the @
But i still get the same problem
<cpanelresult><data><result>0</result><reason>Unknown Error</reason></data></cpanelresult>
The string i am using looks like
Code:
/xml-api/cpanel?user=***&xmlin=<cpanel Email="passwdpop(***, ***, 250, ***)">
All the data seems to be posted the right way as provided above
PHP Code:
// Change email password
$cpusername = '***';
$cppassword = '***';
$host = '***';
$request = '/xml-api/cpanel?user='.$cpusername.'&xmlin=<cpanel Email="passwdpop('.$customers[username].', '.$_POST[pass1].', 250, '.$host.')">';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://$host:2082" . $request);
curl_setopt($ch, CURLOPT_USERPWD, "$cpusername:$cppassword");
$result = curl_exec($ch);
curl_close($ch);
// DDDDEEEEBBBBUUUUGGGG
$Name = "***"; //senders name
$email = "***"; //senders e-mail adress
$mail_body = "Email debugger\n\n$result"; //mail body
$subject = "Email debugger"; //subject
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
mail("***", $subject, $mail_body, $header); //mail command :)