有没有办法从 cPanel 或使用 PHP 创建大量电子邮件帐户?

发布于 2024-12-04 19:19:12 字数 1459 浏览 0 评论 0原文

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

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

发布评论

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

评论(2

捶死心动 2024-12-11 19:19:12

要在不直接使用 cPanel 的情况下创建电子邮件帐户,您可以使用 cPanel & WHM 的 API

看看下面的论坛帖子,它处理同样的事情。

使用 API 创建电子邮件帐户

注意:XML -PHP API 已移至 GitHub,可通过以下链接获取 https://github.com/CpanelInc/xmlapi-php
您可以从 https://github.com/CpanelInc/ 下载 1.0.12 版本xmlapi-php/zipball/v1.0.12

在 zip 中,查看示例目录中的 api1_example.php,这就是您想要的。

更新
简而言之,您可以通过 PHP 脚本这样做

include("../xmlapi.php");

$ip = ip.of.your.server;
$root_pass = 'password_of_your_root_account';

$account = "cpanel_username";

// Email account to create
$email_user = "somerandomuser";
$email_password = "adfm90f1m3f0m0adf";
$email_domain = "somedomain.com";
$email_quota = '10';

// initialize api
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_output('json');

$xmlapi->set_debug(1);
print $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_quota, $email_domain) );

For creating email accounts without using cPanel directly you can use cPanel & WHM's API.

Look at the following forum post, it deals with same thing.

Create Email Account using API

Note: the XML-PHP API has moved to GitHub and is available at following link https://github.com/CpanelInc/xmlapi-php
You can download the 1.0.12 release from https://github.com/CpanelInc/xmlapi-php/zipball/v1.0.12

In the zip look at api1_example.php in Examples directory it is what you want.

Update
In short you can do it like this from a PHP script

include("../xmlapi.php");

$ip = ip.of.your.server;
$root_pass = 'password_of_your_root_account';

$account = "cpanel_username";

// Email account to create
$email_user = "somerandomuser";
$email_password = "adfm90f1m3f0m0adf";
$email_domain = "somedomain.com";
$email_quota = '10';

// initialize api
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_output('json');

$xmlapi->set_debug(1);
print $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_quota, $email_domain) );
又爬满兰若 2024-12-11 19:19:12

如果您的 cPanel 上有 Fantastico 或 Softaculous(或其他一些脚本安装向导)(在“软件/服务”下查找),那么您也许可以安装邮件列表应用程序并使用它。

If you have Fantastico or Softaculous (or some other script installation wizard) on your cPanel (look for it under Software/Services) then you may be able to install a mailing list application and use that.

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