Log In    |    Knowledge Base    |    4D Home
Tech Tip: Retrieving messages using 4D IC IMAP commands
PRODUCT: 4D Internet Commands | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: November 3, 2006

Below is a sample code that shows how to retrieve a message using 4D Internet Commands IMAP commands:
err:=IMAP_Login (hostName;userName;password;imap_ID)
err:=IMAP_SetPrefs (0;"Mac HD:IMAP:MyMessages")
err:=IMAP_SetCurrentMB (imap_ID;mbName;msgNber;newMsgNber;customFlags;permanentFlags;mbUID)
err:=IMAP_Download (imap_ID;msgNum;0;fileName)
err:=IMAP_Logout (imap_ID)

As shown, you first login to the IMAP Server and select the current working mailbox, and then download a specific message (you pass message number to IMAP_Download).