ldsuva

Member
Mar 16, 2009
6
0
51
I have WHM access, how to create email account for the domain using API.

Any inputs are most welcome
Regards
Lakha
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
10
313
Houston, TX
cPanel Access Level
Root Administrator
I have WHM access, how to create email account for the domain using API.

Any inputs are most welcome
Regards
Lakha
If you want to code in PHP 5, I recommend using Matt's PHP 5 class as it makes it much easier to use our APIs. You can find his PHP 5 class at:

http://forums.cpanel.net/f42/xmlapi-php-class-111897.html

The function for creating an email account is an API1 function. The raw function call as it appears in the X3 theme is:

Code:
<cpanel Email="addpop($FORM{'email'},$FORM{'password'},$FORM{'quota'},$FORM{'domain'})">
The first parameter is the portion of the email address before the @ sign (e.g. nobody, if creating [email protected])

The second parameter is the password for the mail account

The third parameter is the disk quota in megabytes (e.g. 250)

The forth parameter is the domain this email address is for (e.g. example.com if creating [email protected]).
 

ldsuva

Member
Mar 16, 2009
6
0
51
Edit email accounts through amlapi

Hello Team


From trial and forum I found command for add/delete/list email accounts but no luck with editing email username or password.

Please help me where I can see these list of function and kindly assist me what is command to chive editing email account user name or password.

1) $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_domain) );
2) $xmlapi->api1_query($account, "Email", "delpop", array($email_user, $email_password, $email_domain) );
3) $xmlapi->api2_query($account, "Email", "listpops","pratikplds.com" );

Please instruct me for editing now.
Thanks in advance
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
10
313
Houston, TX
cPanel Access Level
Root Administrator
Hello Team


From trial and forum I found command for add/delete/list email accounts but no luck with editing email username or password.

Please help me where I can see these list of function and kindly assist me what is command to chive editing email account user name or password.

1) $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_domain) );
2) $xmlapi->api1_query($account, "Email", "delpop", array($email_user, $email_password, $email_domain) );
3) $xmlapi->api2_query($account, "Email", "listpops","pratikplds.com" );

Please instruct me for editing now.
Thanks in advance
Editing a username for an email account is not possible in the cPanel interface, so there will be no API equivalent for that.

For editing an email account's password, you would use:

Code:
<cpanel Email="passwdpop(email, password, quota, domain)">
email is the portion of the email address before @

password is the new password for the email account.

quota is the email quota

domain is the portion of the email address after @
 

ldsuva

Member
Mar 16, 2009
6
0
51
what is this : <cpanel Email="passwdpop(email, password, quota, domain)">

Hello

I dont understand why you people not giving proper instruction.
I wrote I am using below code to get all email account ,<?php
$xmlapi->api2_query($account, "Email", "listpops","pratikplds.com" );
?>

Now please guide me how to use below code like the one above I used.
You are asking to raise ticket, they are saying refer forum, I dont understand the reason.

Please instruct me how to use below code in php, like I used above for getting email accounts.

<cpanel Email="passwdpop(email, password, quota, domain)">

Hope This time I will get answer.
Regards
 

lvt

Well-Known Member
May 23, 2009
49
0
56
cPanel Access Level
Reseller Owner
Hello

I dont understand why you people not giving proper instruction.
I wrote I am using below code to get all email account ,<?php
$xmlapi->api2_query($account, "Email", "listpops","pratikplds.com" );
?>

Now please guide me how to use below code like the one above I used.
You are asking to raise ticket, they are saying refer forum, I dont understand the reason.

Please instruct me how to use below code in php, like I used above for getting email accounts.

<cpanel Email="passwdpop(email, password, quota, domain)">

Hope This time I will get answer.
Regards
I'm not familiar with the PHP class provided here but I guess that you will need something like :

<?php
$xmlapi->api1_query($account, "Email", "passwdpop", array($email, $password, $quota, $domain) );
?>
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
10
313
Houston, TX
cPanel Access Level
Root Administrator
Hello

I dont understand why you people not giving proper instruction.
I wrote I am using below code to get all email account ,<?php
$xmlapi->api2_query($account, "Email", "listpops","pratikplds.com" );
?>

Now please guide me how to use below code like the one above I used.
You are asking to raise ticket, they are saying refer forum, I dont understand the reason.

Please instruct me how to use below code in php, like I used above for getting email accounts.

<cpanel Email="passwdpop(email, password, quota, domain)">

Hope This time I will get answer.
Regards
You mentioned you submitted a ticket about this and you were referred back to the forums. If this was a ticket directly with cPanel, Inc, can you provide me with your ticket ID so I can follow up with this internally?

lvt's post summed up what you need to do. If you need clarification for this even after reviewing the api1 example in the zip file containing the PHP 5 class, please let me know.
 

ldsuva

Member
Mar 16, 2009
6
0
51
Support Request Id 445949 - API function to list email accounts

Hello

Please find below ID:
Support Request Id 445949 - API function to list email accounts
Its Joshua Brown and Mary Wior replied on ticket.

Thanks
 

vibhadevit

Registered
Jul 14, 2009
1
0
51
If Not WHM access then?

Hi all,
i have cpanel username and password but not whm.
what can i do??
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
11
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
What should I ask from my provider to do this?
There may not be anything specific other than ensuring you can login using your account username and password; if you can login then you should be able to attempt to access the XML-API as was previously mentioned. It couldn't hurt to try asking the service provider for assistance connecting to their system via the XML-API; they may be able to help check logs for troubleshooting and also verify the login works.

If what you're seeking to do is similar or the same as the original poster, then you might include a link to this forums thread, or if it is different you might start a new thread to ask in more detail about what you're looking to accomplish.

Here is our related developer documentation for additional reference material:
WebHome < AllDocumentation/AutomationIntegration < TWiki
 

ldsuva

Member
Mar 16, 2009
6
0
51
Warning using Cpanel xml API

Hello
Every thing was fine but recently I am getting warning using same code:

$ip = "XX.xx.xx.xx";

$root_pass = "******";

$account = "test";

$xmlapi = new xmlapi($ip);

$xmlapi->password_auth("root",$root_pass);

$result=$xmlapi->api2_query($account, "Email", "listpops","pratikplds.com" );


Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Extra content at the end of the document in

Regards