Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

php script to create email account is not working

Discussion in 'cPanel Developers' started by ctello, Jul 30, 2011.

  1. ctello

    ctello Registered

    Joined:
    Jul 30, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    I am using the following scrip and the return value is "0 access denied"
    How can I make this work? I got cpanel 11.30.1 (build 4)
    I am desperately in need of help!:confused:

    here is the script:

    <?php
    include 'xmlapi.php';
    $ip = "111.111.111.111";
    $account = "my_cpanel_account_name";
    $account_pass = "my_cpanel_account_password";

    $email_user = "test";
    $email_password = "a11111";
    $email_domain = "mydomainname.com";
    $email_quota = '100';

    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account, $account_pass); /*<-- USE USER ACCOUNT AUTH*/
    $xmlapi->set_output('xml');

    $result = $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_quota, $email_domain) );
    echo "outcome =".$result;
    ?>
     
  2. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Before you execute api1_query, execute set_port(2083);

    What you are doing is calling port 2087, which will deny authentication.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice