Example: imap_get_result

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

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