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!

[ERROR]Creating email with xmlapi

Discussion in 'cPanel Developers' started by matheuscl, Oct 4, 2013.

  1. matheuscl

    matheuscl Registered

    Joined:
    Oct 4, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello, i have one script to create emails in cpanel, with reseller account it's ok but in client accounts i have the error:Access denied 0 Access denied.
    follow script in resseler account:
    <?php
    include_once("xmlapi.php");

    $account_pass = "secret^^";

    $ip = '64.31.16.90';

    $account = "secret^^";
    $email1 = "testmatheustest";
    $email_password = "maisvendas";
    $email_domain = "visolutions.com.br";
    $email_quota = '0';
    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account, $account_pass);
    //$xmlapi->set_port(2083);
    $xmlapi->set_output('xml');

    echo $xmlapi->api1_query($account, "Email", "addpop", array($email1, $email_password, $email_quota, $email_domain));
    ?>
    and the script for client account(not working):
    <?php
    include_once("xmlapi.php");

    $account_pass = "secret^^";

    $ip = '64.31.16.90';

    $account = "secret^^";
    $email1 = "testmatheustest";
    $email_password = "maisvendas";
    $email_domain = "boabarganha.com.br";
    $email_quota = '0';
    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account, $account_pass);
    //$xmlapi->set_port(2083);
    $xmlapi->set_output('xml');

    echo $xmlapi->api1_query($account, "Email", "addpop", array($email1, $email_password, $email_quota, $email_domain));
    ?>
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    I have moved this to the cPanel Developers forum. You should get more input about this topic here.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. matheuscl

    matheuscl Registered

    Joined:
    Oct 4, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    sorry and thanks
     
  4. MesinHosting

    MesinHosting Member

    Joined:
    Mar 25, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    51
    use api2_query instead api1_query

    PHP:
    echo $xmlapi->api2_query($account"Email""addpop", array($email1$email_password$email_quota$email_domain));
     
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