使用 PHP 创建网络邮件帐户

发布于 2024-10-28 15:56:37 字数 83 浏览 1 评论 0原文

如何使用 PHP 创建网络邮件帐户?我正在使用 cPanel。我尝试了几个脚本,但似乎都不起作用,有人可以给我一些见解吗?

非常感谢!!

How can i create webmail accounts using PHP? I am using cPanel. I tried several scripts but none of them seem to work, can someone give me some insight with this?

Thank you very much!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑叹一世浮沉 2024-11-04 15:56:38

这个示例应该只修改将您的访问数据放入单个文件 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=>"[email protected]",language=>"es");
print $xmlapi->createacct($acct);

This example should only modify your access data into a single file config.php and you can create an account easily this way.
I hope you find it useful:

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=>"[email protected]",language=>"es");
print $xmlapi->createacct($acct);
马蹄踏│碎落叶 2024-11-04 15:56:37

您需要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) );

编辑:如果您需要有关 API 的更多信息,请参阅:http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/XmlApi

You need the Cpanel XML API class. Download it here:

http://sdk.cpanel.net/lib/xmlapi/php/cp_xmlapi_php_v1.0.5.tar.gz

It comes with usage examples but this can get you started:

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) );

Edit: If you need more information on the API, see this: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/XmlApi

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文