Hi guys,
first of all i am new to php, so please bear with me.
I have this requirement wherein i need to automatically create email accounts with my hosting provider through my website's php code.
I have a linux hosting account with cpanel interface (its bluehost.com btw, if that matters).
I came across this cpanel xml api which lets you make api calls to access the function of cpanel through your code. I've donwloaded the api file ('xmlapi.php') and followed the forums and all to write my small php code to call the api to create an email account.
Here's the setup
1) i've uploaded 'xmlapi.php' to root folder of my domains hosting folder
2) i've uploaded another php file 'emailaccount.php' to the root folder
Below is the code inside emailaccount.php


    include_once "xmlapi.php" ;
    $ip = "mydomain.com";/*my main domain for the hosting account*/
    $domain = "mydomain.com";/*i want to create ckchaudhary@mydomain.com*/
    $root_pass = "my_cpanels_password";

    $xmlapi = new xmlapi($ip);


    $acct = array( 'username' => "ckchaudhary", 'password' => "Pass1234", 'domain' => $domain);
        $response =  $xmlapi->createacct($acct);
        echo "<hr/><br/>Email account created successfuly";
    catch(Exception $e){
        echo "<strong>Error : </strong>" . $e->getMessage();

The Problem:
$response is always blank. try block is always executed successfuly. But when i login to my cpanel i dont see the new email account listed !
Has anyone worked with cpanel api before? It'd be a great help if someone cud tell me what i need to do

Doesn't your webhost provide any documentation for this? Have you contacted them to ask whether or not it is supported at all?