PHPCheckNumMessagesExample

From Rackspace Email & Apps API
Jump to: navigation, search
<?php

require_once('nusoap.php');

$client = new soapclient('https://secure.webmail.us/soap/soap_server.php?wsdl', true);
$err    = $client->getError();

if ($err)
{
  die("ERROR: $err");
}

$res = $client->call('GetUserNumMessages', 
                     array('ResellerUsername' => 'someadmin',
                           'ResellerPassword' => 'adminpassword',
                           'HostName'         => 'webmail.us',
                           'UserID'           => 'someperson'));

if ($client->fault)
{
    echo "FAULT: ";
    print_r($res);
    exit;
}

$err = $client->getError();
if ($err)
{
    die("ERROR2: $err");
}

print_r($res);

?>