Using cPanel API for changing email password

saliljain25

Registered
Feb 18, 2011
2
0
51
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
 

MattDees

Well-Known Member
Apr 29, 2005
416
1
243
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") );
 

Niku01

Registered
Jan 9, 2011
1
0
51
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.
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
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