Get Autoresponders

Allard

New member
Joined
Mar 18, 2011
Messages
25
Hi,

I have a question. Is there a code, that you can show all autoresponders? I have the below code but how you can show it?

PHP:
$sock->query('/CMD_API_EMAIL_AUTORESPONDER', array('domain' => 'test.nl'));
 
Thanks, but do you have a good code to show the autoresponders? I tried, but it doesn't work.
 
What errors did you get? What code did you use? Will you post the code here (without HTTPSocket.php)? I would check it.
 
To get the list, you should use credentials of the user, who owns the domain, on which the list of autoresponders you wanna get.
 
Okey, I have this code but is doesn't work. Can you help me?

PHP:
        public function ShowResponders($Domain)
        {
                  global $sock; 		 
				  $sock->query('/CMD_API_EMAIL_AUTORESPONDER', array('domain' => $Domain));
				  $result = $sock->fetch_parsed_body();
				  
				  switch ($result)
				  {
					  case ($result['error'] == 1):
					 		 print "There was something wrong with getting all email responders.";
					     	 break;
					  case ($result['error'] == 0):
					  	  $responds = print_r($result, true);
							foreach($responds as $value)
							{
							        print $value;
							}
							 break;
					  default:
					  		 print "It is not possible to retrieve the responders.";
				  }
				  
			}
 
If I put the following code, I get this.

PHP:
$sock->query('/CMD_API_EMAIL_AUTORESPONDER', array('domain' => $Domain));
$result = $sock->fetch_parsed_body();
print_r($result);

// That give me the result:
Array ( [hoi] => [test] => ) 

// But how can I show this in a list?
 
I don't get you. Does any error occur? Or everything is working, but you don't know how to put array indexes into a new array? Or what?
 
It already works. Below is the final code.

PHP:
        public function ShowResponders($Domain)
        {
                  global $sock; 		 
				  $sock->query('/CMD_API_EMAIL_AUTORESPONDER', array('domain' => $Domain));
				  $result = $sock->fetch_parsed_body();
				  
				  switch ($result)
				  {
					  case ($result['error'] == 1):
					 		 print "There was something wrong with getting all email responders.";
					     	 break;
					  case ($result['error'] == 0):
							 foreach($result as $value => $key){
							 		echo "<responder>$value@$Domain</responder>";
							 }							 
							 break;
					  default:
					  		 print "It is not possible to retrieve the responders.";
				  }
				  
			}

ShowResponders('test.nl');
 
Back
Top