Renaming Mail Accounts

Use the rename operation to rename a mail account.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

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.

 

Response Packet Structure

The rename node of the response packet is structured as follows:

 

Samples

Renaming a single mail account

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>
Renaming multiple mail acounts

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>