Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function retrieves the contents of the server's mail queue.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/fetch_mail_queue?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/fetch_mail_queue?api.version=1
 Command Line
whmapi1 fetch_mail_queue

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "data": {
    "records": [
      {
        "time": 1371552781,
        "sender": "elvis@graceland.com",
        "user": null,
        "msgid": "1UotX3-0002HX-Lr",
        "recipients": [
          "pricilla@graceland.com"
        ],
        "frozen": 0,
        "size": 14336
      }
    ]
  },
  "metadata": {
    "command": "fetch_mail_queue",
    "version": 1,
    "reason": "OK",
    "result": 1
  }
}
 Output (XML)
<result>
    <data>
        <records>
            <user/>
            <msgid>1UotX3-0002HX-Lr</msgid>
            <frozen>0</frozen>
            <size>14336</size>
            <time>1371552781</time>
            <sender>elvis@graceland.com</sender>
            <recipients>pricilla@graceland.com</recipients>
        </records>
    </data>
    <metadata>
        <result>1</result>
        <version>1</version>
        <command>fetch_mail_queue</command>
        <reason>OK</reason>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
recordsarray of hashesAn array of hashes of the message information.Each hash includes the user, msgid, frozen, size, time, and sender returns and the recipients array. 

user

integer

The mail message's owner.

This function returns this value in the records array.

A valid username.null

msgid

string

The mail message's ID.

This function returns this value in the records array.

A valid string.1UotX3-0002HX-Lr

frozen

Boolean

Whether the mail message is frozen.

This function returns this value in the records array.

  • 1 — Frozen.
  • 0Not frozen.
0

size

integer

The mail message's size.

This function returns this value in the records array.

A positive integer that measures the message size in bytes.14336

time

integer

The mail message's timestamp.

This function returns this value in the records array.

A valid date in Unix time format. 1371552781

sender

string

The mail message's sender.

This function returns this value in the records array.

A valid string.elvis@graceland.com

recipients

array

An array of the mail message's recipients.

This function returns this array in the records array.

This array includes the mail message recipients' email addresses.pricilla @graceland.com