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!

Help Regarding Email::Autoresponder API

Discussion in 'cPanel Developers' started by toqeer2050, Jan 11, 2013.

  1. toqeer2050

    toqeer2050 Registered

    Joined:
    Jan 11, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    include("xmlapi.php");

    //=======================================
    $server = "127.0.0.1";
    $auser = "cPanel username";
    $pass = "The Password";
    $port = '2083';
    $domain = 'domain.tld';

    //=======================================

    $xmlapi = new xmlapi($server);
    $xmlapi->set_port(2083);
    $xmlapi->password_auth($auser,$pass);
    $xmlapi->set_debug(1);


    // Add new Email autoresponder
    $add_a_email = $_POST['add_a_email'];
    $add_a_from_name = $_POST['add_a_from_name'];
    $add_a_subject = $_POST['add_a_subject'];
    $add_a_content = $_POST['add_a_content'];
    $add_a_start = $_POST['add_a_start'];
    $add_a_stop = $_POST['add_a_stop'];
    $args = array(
    'email' => $add_a_email,
    'from' => $add_a_from_name,
    'subject' => $add_a_subject,
    'body' => $add_a_content,
    'domain' => $domain,
    'html' => '0',
    'interval' => '3600',
    'start' => $add_a_start,
    'stop' => $add_a_stop
    );
    $response = $xmlapi->api1_query($auser, "Email", "addautoresponder", $args);



    I am using above code to make autoresponder plugin. I need help. when user enter values and press submit button will this script work there? or we need to write something more to make this thing working. I am saving this file as autored.php is that ok ? and where is xmlapi.php . should i put it in the same directory where my plugin file autored.php is placed? Please help to complete this plugin for me. I urgently need this.
     
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