Deleting cPanel email forwarder

phizor

Registered
Feb 5, 2013
2
0
1
cPanel Access Level
Root Administrator
Hi Guys,

been strugling with this for a while now!

I'm trying to delete a email forwarder. but went through quite a few forums, but didnt have any luck.

Here is the latest script I have.

<?php
include("includes/xmlapi.php");

$ip = "localhost";
$account = "username";
$passwd ="password";
$port =2083;
$email_domain = "domain.com";

$delforw = "[email protected][email protected]_domain.com";

$xmlapi = new xmlapi($ip);
$xmlapi->set_port($port);
$xmlapi->password_auth($account, $passwd);
$xmlapi->set_debug(0);

$result_forward = $xmlapi->api1_query($account, "Email", "delforward", $delforw);
?>



what I did try previously

Instead of the :

$delforw = "[email protected][email protected]_domain.com";

I used :

$call_f = array(domain=>$email_domain, email=>'[email protected]', fwdopt=>"fwd", fwdemail=>'[email protected]_domain.com');

and then replaced the $delforw with $call_f