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!

Autoresponders php script

Discussion in 'General Discussion' started by phyroslam, Aug 12, 2004.

  1. phyroslam

    phyroslam Registered

    Joined:
    Feb 24, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    151
    I gat this script that adds an autoresponder account :

    $request = "/frontend/$cpmod/mail/doaddars.html?email=$email&domain=$domain&from=$from&subject=$subject&charset=$charset&html=1&body=$body";

    $sock = fsockopen("localhost",$GLOBALS['cpport']);
    if(!$sock)
    {
    //print('Socket error');
    //exit();
    }
    $authstr = $GLOBALS['cpanel_user']. ":" . $GLOBALS['cpanel_password'];
    $pass = base64_encode($authstr);
    $in = "POST $request\r\n";
    $in .= "HTTP/1.0\r\n";
    $in .= "Host:" . $GLOBALS['$systemdomains'] . "\r\n";
    $in .= "Authorization: Basic $pass\r\n";
    $in .= "\r\n";
    //echo $in;

    fputs($sock, $in);
    while (!feof($sock)) {
    fgets ($sock);
    $confirm= fgets ($sock);
    //echo $confirm;
    }
    //echo $confirm;
    fclose( $sock );

    this works fine but, when I truy to delete the autoresponder using this:

    $request = "/frontend/$cpmod/mail/dodelautores.html?email=$email";

    $sock = fsockopen("localhost",$GLOBALS['cpport']);
    if(!$sock)
    {
    //print('Socket error');
    //exit();
    }
    $authstr = $GLOBALS['cpanel_user']. ":" . $GLOBALS['cpanel_password'];
    $pass = base64_encode($authstr);
    $in = "POST $request\r\n";
    $in .= "HTTP/1.0\r\n";
    $in .= "Host:" . $GLOBALS['$systemdomains'] . "\r\n";
    $in .= "Authorization: Basic $pass\r\n";
    $in .= "\r\n";
    //echo $in;

    fputs($sock, $in);
    while (!feof($sock)) {
    fgets ($sock);
    $confirm= fgets ($sock);
    //echo $confirm;
    }
    //echo $confirm;
    fclose( $sock );

    it dosen´t work, what I´m doing wrong, anyone can help me ?
     
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