如何使用PHP创建webmail帐户?我正在使用cPanel。我尝试了几个脚本,但似乎都不起作用,有人能给我一些见解吗?
非常感谢!
发布于 2011-04-02 00:45:06
您需要Cpanel XML API类。请在此处下载:
http://sdk.cpanel.net/lib/xmlapi/php/cp_xmlapi_php_v1.0.5.tar.gz
它提供了用法示例,但这可以帮助您入门:
include('xmlapi.php');
$account = "Cogicero";
$account_pass = "password";
$ip = "xxx.xxx.xxx.xxx";
$email_user = "cogicero";
$email_password = "password";
$email_domain = "cogicero.com";
$email_quota = "100";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth($account, $account_pass);
$xmlapi->set_output('xml');
$result = $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_quota, $email_domain) );编辑:如果您需要更多关于接口的信息,请查看:http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/XmlApi
发布于 2015-10-29 06:37:15
This example应该只将你的访问数据修改成一个单独的文件config.php,这样你就可以很容易地创建一个帐户。我希望你能发现它是有用的:
include_once '../xmlapi.php';
$xmlapi = new xmlapi(SERVER_IP);
$xmlapi->password_auth(ROOT_USER,ROOT_PASSWORD);
$xmlapi->set_debug(1);
$acct = array( username => "someuser", password => "pass123", domain => "thisdomain.com", plan =>"user_plan_diamond", contactemail=>"user@gmail.com",language=>"es");
print $xmlapi->createacct($acct);https://stackoverflow.com/questions/5515856
复制相似问题