Use the rename operation to rename a mail account.
A request XML packet setting a new name for an existing mail account should include the rename operation node:
<packet>
<mail>
<rename>
...
</rename>
</mail>
</packet>
The rename node does not have a separate type, it is nested within the MailTypeRequest type (mail_input.xsd
). The rename node has the following graphics representation:
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The rename node of the response packet is structured as follows:
common.xsd
).The following request packet renames mail account existing on the site with ID 11:
<packet version="1.6.3.0">
<mail>
<rename>
<site-id>11</site-id>
<name>admin</name>
<new-name>administrator</new-name>
</rename>
</mail>
</packet>
Response:
<packet version="1.4.2.0">
<mail>
<rename>
<result>
<status>ok</status>
</result>
</rename>
</mail>
</packet>
To rename multiple mail accounts with a single packet, use a separate rename section for each:
<packet version="1.6.3.0">
<mail>
<rename>
<site-id>11</site-id>
<name>admin</name>
<new-name>administrator</new-name>
</rename>
<rename>
<site-id>11</site-id>
<name>common</name>
<new-name>main</new-name>
</rename>
</mail>
</packet>
Response:
<packet version="1.4.2.0">
<mail>
<rename>
<result>
<status>ok</status>
</result>
</rename>
<rename>
<result>
<status>ok</status>
</result>
</rename>
</mail>
</packet>