Internet Messaging Functions (IMAP) > Alphabetical List of Functions > imap_get_result

imap_get_result

Example: imap_get_result Internet Messaging Functions (IMAP)

Gets an IMAP server return code.

int imap_get_result();

The imap_get_result function gets an IMAP server return code. You use this function to determine the exact error code issued by the IMAP server, for the previous IMAP function.

The following table shows the possible return codes:

Error Code Value Description
IMAP_OK 1 The function succeeded.
IMAP_NO 2 Function execution was denied.
IMAP_BAD 3 The arguments that were passed were either invalid or not allowed.
IMAP_BYE 4 The server closed the connection.
IMAP_PREAUTH 5 The client connected to the server that was previously authenticated.
IMAP_TIMEOUT -1 The IMAP operation failed to return a result.
IMAP_DISCONNECTED -2 The IMAP session is no longer connected to the server.
IMAP_NOSESSION -3 No IMAP session exists—no session was created.
IMAP_INVALID -4 Invalid client-side arguments were used in the imap_* function.

This function is for use with global sessions. For multiple sessions, use the imap_get_result_ex function, which allows you to specify a session identifier.

Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.

Parameterization

Standard parameterization is not available for this function.