Description

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

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/fetch_mail_queue?api.version=1




https://hostname.example.com:2087/cpsess##########/xml-api/fetch_mail_queue?api.version=1




whmapi1 fetch_mail_queue



{
  "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
  }
}




<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>



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