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 ?
$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 ?