0

我正在使用以下代码同时创建一个电子邮件帐户和一个电子邮件转发。我很困惑,因为电子邮件转发每次都有效(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);
4

2 回答 2

2

与 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.html 2. http://forums.cpanel.net/f42/xmlapi-php-class-111897 .html

您可以在 cpanel 的 support for assistant 中寻求支持..

于 2013-12-30T10:27:25.993 回答
2

雅虎正在关闭 Yahoo Mail Classic,所以我不得不实现自己的电子邮件。我目前使用 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您想要使用该功能。

于 2013-06-14T21:35:49.623 回答