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.

Using cPanel API for changing email password

Discussion in 'cPanel Developers' started by saliljain25, Feb 18, 2011.

  1. saliljain25

    saliljain25 Registered

    Joined:
    Feb 18, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I've been able to use the
    XMLAPI php class : http://forums.cpanel.net/f42/xmlapi-php-class-111897.html
    to add and list email accounts on my cPanel hosting, but some how i am not being able to get the code right for changing passwords ,


    $xmlapi = new xmlapi("Primary CPANEL domain");
    $xmlapi->password_auth("username",$root_pass);
    $account = "Cpanel username";
    $xmlapi->api2_query($account, "Email", "passwdpop", array("domain name", "user name", "new password") );

    but i really need this to work! What am I doing wrong? please help me out.
    Thanks
     
  2. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Well, this is an API2 call, meaning it uses associative arrays as parameters rather than regular arrays, so you would actually do something like:

    PHP:
    $xmlapi = new xmlapi("Primary CPANEL domain");
    $xmlapi->password_auth("username",$root_pass);
    $account "Cpanel username";
    $xmlapi->api2_query($account"Email""passwdpop", array( 'domain' => "domain name"'email' => "user name"'password' => "new password") );
     
  3. Niku01

    Niku01 Registered

    Joined:
    Jan 9, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello. I don't want to open a new thread because i have a pretty similar issue .

    So it works for me the above code, but its any way to change the email password without the cpanel account ? Maybe with that email acctual password as a verification , but not with the cpanel account ?

    Thank you.
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Niku01,

    Currently there is not a programmatic way (API call) that will allow an email account user change their own password outside the context of the webmail interface. I would suggest creating a feature request in the feature request forum for this functionality.

    Best Regards,
    -DavidN
     
Loading...

Share This Page