Example: imap_get_result_ex

In the following example, the imap_get_result_ex function gets the IMAP error code for imap_store.

    if (imap_store(....) == LR_FAIL) {
      int reason = imap_get_result_ex(&imap1);
	if (reason == IMAP_BAD) { 
            // Bad command sent to server...
        } else if (reason == IMAP_NO) {
            // Not allowed to perform store operation
        }
    }