Example #1
0
<?php

require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));
try {
    if ($session_id = $client->login($username, $password)) {
        echo 'Logged successfull. Session ID:' . $session_id . '<br />';
    }
    //* Set the function parameters.
    $client_id = 1;
    $params = array('server_id' => 1, 'email' => '*****@*****.**', 'login' => '*****@*****.**', 'password' => 'howtoforge', 'name' => 'joe', 'uid' => 5000, 'gid' => 5000, 'maildir' => '/var/vmail/test.int/joe', 'quota' => 5242880, 'cc' => '', 'homedir' => '/var/vmail', 'autoresponder' => 'n', 'autoresponder_start_date' => array('day' => 1, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), 'autoresponder_end_date' => array('day' => 20, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), 'autoresponder_text' => 'hallo', 'move_junk' => 'n', 'custom_mailfilter' => 'spam', 'postfix' => 'n', 'access' => 'n', 'disableimap' => 'n', 'disablepop3' => 'n', 'disabledeliver' => 'n', 'disablesmtp' => 'n');
    $affected_rows = $client->mail_user_add($session_id, $client_id, $params);
    echo "New user: "******"<br>";
    if ($client->logout($session_id)) {
        echo 'Logged out.<br />';
    }
} catch (SoapFault $e) {
    echo $client->__getLastResponse();
    die('SOAP Error: ' . $e->getMessage());
}
Example #2
0
  * db : dbispconfig -> mail_domain
  * 
  * */
 //* Set the function parameters.
 $paramsMailDomainAdd = array('server_id' => 1, 'domain' => $newDomain, 'active' => 'y');
 $newMailDomainID = $client->mail_domain_add($session_id, $client_id, $paramsMailDomainAdd);
 echo "Mail Domain ID: " . $newMailDomainID . "<br>";
 //*/
 /* mail_user_add
  * 
  *  db : dbispconfig -> mail_user
  *  
  *  */
 //* Set the function parameters.
 $paramsMailUserAdd = array('server_id' => 1, 'email' => 'info' . '@' . $newDomain, 'login' => 'info' . '@' . $newDomain, 'password' => $password_email, 'name' => 'info', 'uid' => 5000, 'gid' => 5000, 'maildir' => '/var/vmail/' . $newDomain . '/' . 'info', 'quota' => $quota_mail, 'cc' => '', 'homedir' => '/var/vmail', 'autoresponder' => 'n', 'autoresponder_start_date' => '0000-00-00 00:00:00', 'autoresponder_end_date' => '0000-00-00 00:00:00', 'move_junk' => 'n', 'postfix' => 'y', 'access' => 'y', 'disableimap' => 'n', 'disablepop3' => 'n', 'disabledeliver' => 'n', 'disablesmtp' => 'n');
 $newMailUserID = $client->mail_user_add($session_id, $client_id, $paramsMailUserAdd);
 echo "New user: "******"<br>";
 //*/
 /* logging out */
 if ($client->logout($session_id)) {
     echo 'Logged out.<br />';
 }
 /* show output to the user and eventually send mail with it */
 echo "</br></br>";
 echo "Client created with credentials : </br>";
 echo "Username " . $clientUsername . "</br>";
 echo "Password " . $clientPassword . "</br>";
 echo "ID : " . $clientID . "<br>";
 echo "</br>";
 echo "Domain - " . $newDomain . "</br>";
 echo "</br>";