Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

xmlapi: could not find function "addautoresponder" in module email

Discussion in 'cPanel Developers' started by barlow, Sep 1, 2013.

  1. barlow

    barlow Member

    Joined:
    Mar 27, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Using xmlapi to manage email accounts has been going well until I started working with 'addautoresponder', which is coming back with the error "could not find function 'addautoresponder' in module 'email".

    Is there something I should know? Is there some new function? Am I accessing API 1 incorrectly? I read somewhere that API 1 requires an ordered param array rather than a hashed param array, but that's from some years ago, right?

    The code looks like this:

    PHP:
    $params = array('domain'=>$domain
                
    'email'=>$row['email'], 
                
    'from'=>$row['Full Name'], 
                
    'subject'=>$Subject,
                
    'body'=>$Body,
                
    'html'=>true,
                
    'interval'=>4,
                
    'start'=>$startTS,
                
    'stop'=>$endTS); 

    $res json_decode($xmlapi->api2_query($cpanelu"Email""addautoresponder"$params), true);
    Any suggestions or guidance would be appreciated.

    By the way, the people who developed xmlapi interface for CPANEL are heros!
     
  2. barlow

    barlow Member

    Joined:
    Mar 27, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    OK, to answer my own question. Looking through xmlapi.php revealed that there are query functions for API1 and API2 - I hadn't noticed, duh. So the *working* code looks like this, with an ordered array as per the API documentation and 'api1_query' called:

    PHP:
    $params = array($username
            
    $row['Full Name'], 
            
    $Subject,
            
    $Body,
            
    $domain,
            
    true,
            
    "us-ascii",
            
    4,
            
    $startTS,
            
    $endTS); 
                
    $res json_decode($xmlapi->api1_query($cpanelu"Email""addautoresponder"$params), true);
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,897
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    I am happy to hear you were able to resolve the issue. Thank you for sharing the solution.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice