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!

can't get postwwwacct to create e-mail account with php

Discussion in 'E-mail Discussion' started by noimad1, Apr 12, 2010.

  1. noimad1

    noimad1 Well-Known Member

    Mar 27, 2003
    Likes Received:
    Trophy Points:
    So here is the script I'm trying to run inside /scripts/postwwwacct:


    #!/usr/local/bin/php -q

    $opts = array();
    $argv0 array_shift($argv);
    count($argv)) {
    $key array_shift($argv);
    $value array_shift($argv);
    $opts[$key] = $value;

    $account $opts['user'];
    $email_domain $opts['domain'];

    $email_user "emailaddress1";
    $email_password "emailaccountpass";
    $email_quota '110';

    $ip "";
    $root_pass "mypassword";
    $xmlapi = new xmlapi($ip);

    $result $xmlapi->api1_query($account"Email""addpop", array($email_user$email_password$email_quota$email_domain) );


    And I'm using the sample xmlapi.php code provided by cpanel. If I change $account to a manual account name it seems to work ok. However, the way it stands now no e-mail account is created? So I'm thinking the opts array maybe isn't getting set, but of course I haven't found a way to debug any output when actually creating the account through the WHM, because it just says "running /scripts/postwwwacct" but doesn't give any output.

    Does anyone see anything wrong or missing with this script?

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