Skip to content

Commit 745b408

Browse files
author
Demian
committed
add documentation and example for new mail_relay_domain_add api function #6399
1 parent 54c57f3 commit 745b408

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html><head><title>ISPCOnfig 3 remote API documentation</title>
3+
4+
5+
6+
7+
8+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9+
<link rel="stylesheet" type="text/css" href="definitionen.css">
10+
<style type="text/css">
11+
</style></head>
12+
13+
<body>
14+
<div style="padding:40px">
15+
<h1>mail_relay_domain_add(<span class="var">$session_id</span>, <span class="var">$client_id</span>, <span class="var">$params</span>);</h1>
16+
<br>
17+
<p class="headgrp">Description: </p>
18+
<p class="margin"> Adds a new relay domain.</p><br>
19+
<p class="headgrp">Input Variables: </p>
20+
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$client_id</span>, <span class="var">$params</span></p>
21+
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
22+
<p class="margin"> server_id&nbsp;&nbsp;(<span class="paratype">int(11)</span>)</p>
23+
<p class="margin"> source&nbsp;&nbsp;Recipient address (<span class="paratype">varchar(255)</span>)</p>
24+
<p class="margin"> active&nbsp;&nbsp;(<span class="paratype">enum('n','y')</span>)</p>
25+
<p class="margin"> access&nbsp;&nbsp;(<span class="paratype">varchar(255)</span>)</p>
26+
<p class="headgrp">Output: </p>
27+
<p class="margin"> Returns the ID of the newly added record</p>
28+
<!--<b>Output:</b>
29+
<p style="margin-left:100px">Gives a record of </p> -->
30+
</div>
31+
32+
</body></html>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
require 'soap_config.php';
4+
5+
6+
$client = new SoapClient(null, array('location' => $soap_location,
7+
'uri' => $soap_uri,
8+
'trace' => 1,
9+
'exceptions' => 1));
10+
11+
12+
try {
13+
if($session_id = $client->login($username, $password)) {
14+
echo 'Logged successfull. Session ID:'.$session_id.'<br />';
15+
}
16+
17+
//* Set the function parameters.
18+
$client_id = 1;
19+
$params = array(
20+
'server_id' => 1,
21+
'domain' => 'test.tld',
22+
'active' => 'y',
23+
'access' => 'OK'
24+
);
25+
26+
$relay_domain_id = $client->mail_relay_domain_add($session_id, $client_id, $params);
27+
28+
echo "Relay domain ID: ".$relay_domain_id."<br>";
29+
30+
if($client->logout($session_id)) {
31+
echo 'Logged out.<br />';
32+
}
33+
34+
35+
} catch (SoapFault $e) {
36+
echo $client->__getLastResponse();
37+
die('SOAP Error: '.$e->getMessage());
38+
}
39+
40+
?>

0 commit comments

Comments
 (0)