我正在尝试使用 php 脚本在 bluehost cpanel 中创建电子邮件帐户。我为此尝试了 XML API,但它给出了“拒绝访问”错误。
现在我正在尝试使用以下代码做同样的事情,但没有成功。我可以登录 CPanel 但无法创建电子邮件帐户。
$login = "https://my.bluehost.com/cgi/account/cpanel";
$time=time();
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $login);
curl_setopt($c, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($c, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, "ldomain=$username&lpass=$password&l_redirect=/cgi-bin/cplogin&l_server_time=$time&l_expires_min=0");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
$login_done1 = curl_exec($c);
print_r($login_done1);
$email= "https://$cpanel:2083/frontend/bluehost/mail/doaddpop.html";
curl_setopt($c, CURLOPT_URL, $email);s
curl_setopt($c, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($c, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, "email=ddddd&domain=test.org&password=test@1617&password2=test@1617"a=250&new_email_submit=Create");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
$login_done2 = curl_exec($c);
print_r($login_done2);
任何帮助表示赞赏!