commit | author | age
|
542146
|
1 |
<?php |
T |
2 |
|
|
3 |
$username = 'admin'; |
|
4 |
$password = 'admin'; |
|
5 |
|
|
6 |
$soap_location = 'http://localhost:8080/remote/index.php'; |
|
7 |
$soap_uri = 'http://localhost:8080/remote/'; |
|
8 |
|
|
9 |
|
|
10 |
$client = new SoapClient(null, array('location' => $soap_location, |
|
11 |
'uri' => $soap_uri)); |
|
12 |
|
|
13 |
|
|
14 |
try { |
|
15 |
if($session_id = $client->login($username,$password)) { |
|
16 |
echo 'Zalogowany. Sesja:'.$session_id.'<br />'; |
|
17 |
} |
|
18 |
|
|
19 |
$params = array( 'server_id' => 1, |
|
20 |
'type' => 'pop3', |
|
21 |
'source_server' => 'replikant.eu', |
|
22 |
'source_username' => 'alias', |
|
23 |
'source_password' => 'qazxsw', |
|
24 |
'source_delete' => 'y', |
|
25 |
'destination' => 'ktos@replikant.eu', |
|
26 |
'active' => 'y'); |
|
27 |
|
|
28 |
|
|
29 |
$client_id = 0; |
|
30 |
$domain_id = $client->mail_fetchmail_add($session_id,$client_id,$params,$domain_id); |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
if($client->logout($session_id)) { |
|
35 |
echo 'Wylogowany.<br />'; |
|
36 |
} |
|
37 |
|
|
38 |
|
|
39 |
} catch (SoapFault $e) { |
|
40 |
die('SOAP Blad: '.$e->getMessage()); |
|
41 |
} |
|
42 |
|
|
43 |
?> |