Hi,
This is my first post on this forum, first off thanks for developing such a useful class for Cpanel. I have got just about every function I require working but am having some problems trying to add an email account with addpop.
below is how I am trying to use the addpop method in the class:
XMLAPI Object created with the following code snippet: (uses user= root, and root password)
$xmlapi = new xmlapi($CP_HOST, $CP_USER, $CP_PASSWORD);
$username = 'CP_User';
$args['email_user'] = 'test';
$args['email_password'] = 'emailpassword';
$args['email_quota'] = 250;
$args['email_domain'] = 'mydomain.com';
$emailAccResult = $xmlapi->addpop($username, $args);
XMLAPI Class addpop method executes with the following line of code:
return $this->api1_query($username, "Email", "addpop", $args);
Each time I try to add an email account returns the following output:
SimpleXMLElement Object ( [module] => Email [func] => addpop [type] => event [source] => internal [apiversion] => 1 [data] => SimpleXMLElement Object ( [result] => Sorry, the given email address is invalid. ) [event] => SimpleXMLElement Object ( [result] => 1 ) )
I have tried using
$xmlapi->password_auth("relatedcpanelusername",$root_pass);
but just the same output. Seems to be allowing me access but I can't figure out why the says the email address is invalid
I have also tried to create new email account directly through cpanel with the details using in the script and creates this no problem.
Any help would be appriciated.
Thanks Adam.
This is my first post on this forum, first off thanks for developing such a useful class for Cpanel. I have got just about every function I require working but am having some problems trying to add an email account with addpop.
below is how I am trying to use the addpop method in the class:
XMLAPI Object created with the following code snippet: (uses user= root, and root password)
$xmlapi = new xmlapi($CP_HOST, $CP_USER, $CP_PASSWORD);
$username = 'CP_User';
$args['email_user'] = 'test';
$args['email_password'] = 'emailpassword';
$args['email_quota'] = 250;
$args['email_domain'] = 'mydomain.com';
$emailAccResult = $xmlapi->addpop($username, $args);
XMLAPI Class addpop method executes with the following line of code:
return $this->api1_query($username, "Email", "addpop", $args);
Each time I try to add an email account returns the following output:
SimpleXMLElement Object ( [module] => Email [func] => addpop [type] => event [source] => internal [apiversion] => 1 [data] => SimpleXMLElement Object ( [result] => Sorry, the given email address is invalid. ) [event] => SimpleXMLElement Object ( [result] => 1 ) )
I have tried using
$xmlapi->password_auth("relatedcpanelusername",$root_pass);
but just the same output. Seems to be allowing me access but I can't figure out why the says the email address is invalid
I have also tried to create new email account directly through cpanel with the details using in the script and creates this no problem.
Any help would be appriciated.
Thanks Adam.