Example: imap_search_ex

In the following example, the imap_search_ex function searches for messages that have the \\FLAG tag, that were modified since 1-FEB-1994, and contain Smith in the From field. It saves these messages to Param1.

    imap_search_ex(&imap1,"SearchForSmith",
        "Search=FLAGGED SINCE 1-FEB-1994 FROM \"Smith\"",
        "SaveTo=Param1",ENDITEM,
         LAST );

In the following example, the imap_search_ex function gets the UIDs.

imap_search_ex(&imap1, "SearchMessages",
	"Mode=UID",
	"Search=ALL", // or any other search criteria
	"SaveTo=search_res1", ENDITEM,
	LAST);

Parse "search_res1" to get UIDs.