The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[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:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  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:
    1
    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