Hi it is very complicated, however I downloaded a PHP examples and uploaded it to my server, then I modified the example.php file and I tried to run it but it had no effect. I am unsure how to determine the SITE ID and whether I need to modify the <packet> </packet> section.
Guru, please, can you have a look and help me modify this in order to add ONE email account at domain itskynet.uk?
#!/usr/bin/env php
<?php
// Copyright 1999-2016. Parallels IP Holdings GmbH. All Rights Reserved.
require_once('PleskApiClient.php');
$host = getenv('itskynet.uk');
$login = getenv('admin') ?: 'admin';
$password = getenv('xxx');
$client = new PleskApiClient($host);
$client->setCredentials($login, $password);
$request = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<packet>
<mail>
<create>
<filter>
<site-id>1</site-id>
<mailname>
<name>techdept11</name>
<mailbox>
<enabled>true</enabled>
<quota>1024000</quota>
</mailbox>
<forwarding>
<enabled>true</enabled>
<address>
[email protected]</address>
</forwarding>
<alias>michael555</alias>
<autoresponder>
<enabled>true</enabled>
<subject>Your request is accepted</subject>
<content_type>text/html</content_type>
<charset>UTF-8</charset>
<text>Your request will be processed in the nearest 10 days. Thank you.</text>
<attachment>
<tmp-name>/tmp/attachment-file.txt</tmp-name>
<file-name>rules.txt</file-name>
</attachment>
<forward>
[email protected]</forward>
</autoresponder>
<password>
<value>test123</value>
<type>plain</type>
</password>
<antivir>inout</antivir>
</mailname>
<mailname>
<name>admin11</name>
<password>
<value>test</value>
</password>
<antivir>inout</antivir>
</mailname>
</filter>
</create>
</mail>
</packet>
EOF;
$response = $client->request($request);
echo $response;