繁体   English   中英

在PHP中使用cPanel XML API更改电子邮件密码

[英]Changing Email Passwords With cPanel XML API in PHP

我一直在慢跑着想如何让我的用户使用cPanels XML API更改密码。 我已经用谷歌搜索过,玩过示例代码,却找不到任何可以远程工作的东西。 有人可以告诉我我在做什么错吗? 谢谢!

require_once('../includes/xmlapi.php');

$ip = '127.0.0.1';
$root_pass = 'secret';

$account = 'accountna';
$email_account = $_POST['email'];
$email_domain = "mydomain.com";

$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_debug(1);

$args = array(
  'domain'=>$email_domain, 
  'email'=>$email_account
);


if ($xmlapi->api2_query($account, "Email", "passwdpop", array( 'domain' => "domain name", 'email' => "user name", 'password' => "new password") )) {
    echo "Success!";
};

您要设置端口了! 在password_auth之前

$xmlapi->set_port ( 2083 );
$xmlapi->password_auth("root",$root_pass);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM