Example: imap_fetch

In the following example, the imap_fetch function fetches information from messages 1 through 10—Message ID, flags, and the RFC822 size and header of the message.

imap_fetch("FetchMessages", 
        "Mode=", 
        "Fetch=1:10 (UID FLAGS RFC822.SIZE RFC822.HEADER)", ENDITEM, 
        LAST );