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.

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:
    1
    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,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Before $result =, try adding the following code

    PHP:
    $xmlapi->set_debug(1);
     
Loading...

Share This Page