使用fopen创建cPanel电子邮件帐户



我使用下面的代码同时创建一个电子邮件帐户和一个电子邮件转发。我很困惑,因为邮件转发每次都工作(f2),而邮件创建只工作了大约一半的时间(f1)。我是一个PHP新手,不能理解是什么原因导致这个。任何帮助都是感激的!

$f = fopen ("https://$cpuser:$cppass@$cpdomain:2083/frontend/$cpskin/mail/doaddpop.html?email=$username&domain=$cpdomain&password=$password&quota=0", "r");
        fclose($f);
    $f2 = fopen ("https://$cpuser:$cppass@$cpdomain:2083/frontend/$cpskin/mail/doaddfwd.html?email=all&domain=$cpdomain&fwdemail=$email&fwdopt=fwd&submit=Add Forwarder", "r");
        fclose($f2);

雅虎正在关闭雅虎邮件经典,所以我不得不实现我自己的电子邮件。我目前使用的是JustHost。我已经尽力让变量变得容易理解。如果你不明白他们的意思,那么首先联系你的主人,因为(假设你有一个称职的技术人员)他们会理解你需要什么。

<?php
//exampledot.com for domain
$cpuser = 'exampled';////////////e.g. exampled, your cPanel main domain usually
$cppass = 'CPANEL-PASSWORD';/////Your cPanel password.
$cpdomain = 'exampledot.com';////The cPanel domain
$cpskin = 'justhost';////////////listed on cPanel as 'theme'
$emailname = 'john1';/////////////The username, e.g. john1@exampledot.com
$emaildomain = 'exampledot.com';////The domain name in email, @exampledot.com
$emailpass = 'EMAIL_PASSWORD';////The password for the email account
$quota = '25';///////////////////Megabytes of space, 0 for unlimited

$homepage = file_get_contents("https://$cpuser:$cppass@$cpdomain:2083/frontend/$cpskin/mail/doaddpop.html?email=$emailname&domain=$emaildomain&password=$emailpass&quota=$quota");
echo $homepage;
?>

我只使用了这段代码,然后检查了cPanel,并创建了电子邮件帐户。

所以你的URL确实工作,它只是file_get_contents函数是你想要使用的。

with fopen

$fopen ("http://$cp_user:$cp_pass@$cp_domain:2082/frontend/$cp_skin/mail/doaddpop.html?email=$user&domain=$e_domain&password=$e_pass"a=$e_quota", "r");

1. http://tobbynews.com/create-e-mail-account-in-c-panel-using-php.html2. http://forums.cpanel.net/f42/xmlapi - php类- 111897. - html

最新更新