commit | author | age
|
413d3b
|
1 |
<?php |
T |
2 |
|
b1a6a5
|
3 |
require 'soap_config.php'; |
413d3b
|
4 |
|
T |
5 |
|
|
6 |
$client = new SoapClient(null, array('location' => $soap_location, |
b1a6a5
|
7 |
'uri' => $soap_uri, |
MC |
8 |
'trace' => 1, |
|
9 |
'exceptions' => 1)); |
413d3b
|
10 |
|
T |
11 |
|
|
12 |
try { |
b1a6a5
|
13 |
if($session_id = $client->login($username, $password)) { |
413d3b
|
14 |
echo 'Logged successfull. Session ID:'.$session_id.'<br />'; |
T |
15 |
} |
b1a6a5
|
16 |
|
413d3b
|
17 |
//* Set the function parameters. |
T |
18 |
$client_id = 1; |
|
19 |
$params = array( |
b1a6a5
|
20 |
'server_id' => 1, |
MC |
21 |
'type' => 'pop3', |
|
22 |
'source_server' => 'webzor.ext', |
|
23 |
'source_username' => 'someguy', |
|
24 |
'source_password' => 'somepassword', |
|
25 |
'source_delete' => 'n', |
|
26 |
'destination' => 'hmmnoe@test.int', |
|
27 |
'active' => 'y', |
|
28 |
'source_read_all' => 'y', |
|
29 |
); |
|
30 |
|
413d3b
|
31 |
$fetchmail_id = $client->mail_fetchmail_add($session_id, $client_id, $params); |
T |
32 |
|
|
33 |
echo "Fetchmail ID: ".$fetchmail_id."<br>"; |
b1a6a5
|
34 |
|
413d3b
|
35 |
if($client->logout($session_id)) { |
T |
36 |
echo 'Logged out.<br />'; |
|
37 |
} |
b1a6a5
|
38 |
|
MC |
39 |
|
413d3b
|
40 |
} catch (SoapFault $e) { |
T |
41 |
echo $client->__getLastResponse(); |
|
42 |
die('SOAP Error: '.$e->getMessage()); |
|
43 |
} |
|
44 |
|
|
45 |
?> |