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!

changing email password with xmlapi

Discussion in 'cPanel Developers' started by bwor, Jun 11, 2012.

  1. bwor

    bwor Member

    Joined:
    Jun 15, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    51
    This script is not changing the email password so what is wrong here ?
    PHP:
    include("xmlapi.php");

    $ip 'yourdomain.com';
    $root_pass 'cpanelpass';

    $account "cpaneluser";
    $email_account "youremail";
    $email_domain "yourdomain.com";
    $new_pass "newpass";

    $xmlapi = new xmlapi($ip);
                
    $xmlapi->set_port('2083');
    $xmlapi->password_auth($account,$root_pass);

    $args = array(
      
    'domain'=>$email_domain
      
    'email'=>$email_account,
      
    'password'=>$new_pass
    );

    $result $xmlapi->api2_query($account"Email""passwdpop "$args);  
                
    $xml_result = new SimpleXMLElement($result);    
                print 
    $xml_result;
    I want to display the result of $xml_result

    I get an error for that so script change the password but I need to display the result of execute this script
     
    #1 bwor, Jun 11, 2012
    Last edited: Jun 11, 2012
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Before $result =, try adding the following code

    PHP:
    $xmlapi->set_debug(1);
     
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