Use the add-list operation to add a new mailing list.
A request XML packet adding a mailing list to Plesk database includes the add-list operation node:
<packet>
<maillist>
<add-list>
...
</add-list>
</maillist>
</packet>
The add-list node is presented by the MaillistAddListInputType type (maillist.xsd
), and its graphical representation is as follows:
Remarks
You can add multiple mailing lists in a single packet. Add as many add-list operations as the number of mailing lists to be added.
<add-list>
...
</add-list>
...
<add-list>
...
</add-list>
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The add-list node of the output XML packet is presented by type MaillistAddOutputType (maillist.xsd
) and structured as follows:
common.xsd
).
This request packet adds mailing list MyMailer to the site specified by ID 45.
<packet>
<maillist>
<add-list>
<site-id>45</site-id>
<name>MyMailer</name>
<password>hello</password>
<admin-email>admin@mysite.com</admin-email>
</add-list>
</maillist>
</packet>
Response:
<packet>
<maillist>
<add-list>
<result>
<status>ok</status>
<id>133</id>
</result>
</add-list>
</maillist>
</packet>
If the Mailman software is not installed on the server, the response looks as follows:
<packet>
<maillist>
<add-list>
<result>
<status>error</status>
<errcode>1031</errcode>
<errtext>Component is not configured on server</errtext>
</result>
</add-list>
</maillist>
</packet>
This request packet adds mailing lists MyMailer and SubscribeMe to the site specified by ID 45.
<packet>
<maillist>
<add-list>
<site-id>45</site-id>
<name>MyMailer</name>
<password>hello</password>
<admin-email>admin@mysite.com</admin-email>
</add-list>
<add-list>
<site-id>45</site-id>
<name>SubscribeMe</name>
<password>123456</password>
<admin-email>admin@mysite.com</admin-email>
</add-list>
</maillist>
</packet>
Response:
<packet>
<maillist>
<add-list>
<result>
<status>ok</status>
<id>133</id>
</result>
</add-list>
<add-list>
<result>
<status>ok</status>
<id>134</id>
</result>
</add-list>
</maillist>
</packet>