Zubrag.com
December 06, 2019, 07:43:34 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Email creator - delete option?  (Read 6422 times)
JBELL
Newbie
*
Posts: 2


« on: February 13, 2008, 07:12:15 AM »

is there a script to delete the e-mails created with cpemail.php? like the script to delete e-mailforwarder (http://www.zubrag.com/forum/index.php/topic,369.0.html? I would be very grateful... !

Logged
JBELL
Newbie
*
Posts: 2


« Reply #1 on: February 13, 2008, 08:41:50 AM »

ok, got a solution Cheesy
Code:
<?php

###############################################################
# Delete Email on cPanel
###############################################################

// cpanel user (the one you login to cpanel)
define('CPANELUSER','xxxxxxxxxx');

// cpanel password (the one you login to cpanel)
define('CPANELPASS','xxxxxxxxxxxxx');

// your cpanel domain (localhost, or domain name)
define('CPANELDOMAIN','xxxxxxxxxxxxx');

// cPanel skin (usually "x")
// Check http://www.zubrag.com/articles/determine-cpanel-skin.php to know it for sure
define('CPANEL_SKIN','x');

////////////////////////////////////////////////////////////////
/////////////////////// END OF SETTINGS ////////////////////////
////////////////////////////////////////////////////////////////

function getVar($name$def '') {
  if (isset(
$_REQUEST[$name]) && ($_REQUEST[$name] != ''))
    return 
$_REQUEST[$name];
  else
    return 
$def;
}

$cpuser CPANELUSER;
$cppass CPANELPASS;
$cpdomain CPANELDOMAIN;
$cpskin CPANEL_SKIN;

$email=getVar('email');
$domain=getVar('domain');

if (empty(
$email) || empty($domain)) {
  echo 
"<h1>Delete Email Forwarder on cPanel</h1>";
  echo 
"All fields are required.<br>
<form method='post'>
  username:<input name='email' value='$email'> (sample: john)<br>
  domain: <input name='domain' value='$domain'> (sample: site2.com)<br>
  <input type='submit' value='Delete EMail' style='border:1px solid black'>
</form>"
;
  die();
}

// Delete email
$f = @fopen
("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/dodelpop_best.html?email=$email&domain=$domain",
 
"r");
if (!
$f) {
  die(
'Cannot delete EMail.');
}

@
fclose($f);

echo 
"Email deleted: $email@$domain";

?>

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC