Is there a way to auto create an email account within cpanel like hotmail/gmail does with a php script?
I did a search on these forums found many links, all but one dead and it wanted $99. Looking for a free script.
Thanks
PrinceShoko
Is there a way to auto create an email account within cpanel like hotmail/gmail does with a php script?
I did a search on these forums found many links, all but one dead and it wanted $99. Looking for a free script.
Thanks
PrinceShoko
PHP Code:<? require '/usr/local/Cpanel/Accounting.php.inc';
$host = "localhost";
$user = "root";(or you username)
$accesshash ='(insert your access hash here)';
createacct ($host,$user,$accesshash,$usessl,$domain,$username,$password,$package) ;
?>
That looks like a script used to create a hosting account right?
Im looking to auto create email accounts inside an already existing cpanel account with a php submit page.
Or am i misunderstanding the code here?
Yep, this peace of script is creating a new hosting account.![]()
But!... if you now take a look into /usr/local/cpanel/Cpanel/Accounting.php.inc you see how easy it is to add new functions into the script.
time to brush up on my php it looks like. Thanks for the nudge.
I would recommend using the XML API because it offers greater flexibility. You can find the XML API documentation at:
http://www.cpanel.net/plugins/xmlapi/index.html
The cool thing with the XML API is you can call API2 functions from it as well. For a list of additional functionality available via API2, refer to the API2 documentation at:
http://www.cpanel.net/plugins/api2/index.html
Hi mate,
Use this ammended function I made just for the same purpose
PHP Code:function createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctemail,$acctplan) {
$result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&contactemail=${acctemail}&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=${acctplan}",$host,$user,$accesshash,$usessl);
if ($cpanelaccterr != "") { return; }
return $result;
}
Thank you david and Phil.
By now, I'll use phil's function, and I'll begin to adapt my system to the new api soon.