Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5    Statistic  

CURL.GetResultAsEMailList

Parses result of an IMAP list query.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 9.0 Yes Yes Yes Yes Yes
MBS( "CURL.GetResultAsEMailList"; curl )   More

Parameters

Parameter Description Example value
curl The CURL session handle. $curl

Result

Returns JSON or error.

Description

Parses result of an IMAP list query.
Returns result as JSON with details for emails.

Examples

Query email list as JSON:

Go to Layout [ “IMAP Postbox” (IMAP Postbox) ; Animation: None ]
# get URL
Set Variable [ $URL ; Value: "imap://imap.monkeybreadsoftware.de/INBOX" ]
# query list of emails
Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionURL"; $curl; $URL) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUsername"; $curl; IMAP Postbox::Username) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionPassword"; $curl; IMAP Postbox::Password) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) // required ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) // TLS v1.2 ]
# Set query for all emails by UID. Not all fields are needed. Only request those you need to make it quicker.
Set Variable [ $r ; Value: MBS("CURL.SetOptionCustomRequest"; $curl; "UID FETCH 1:* (FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (Message-Id DATE FROM SUBJECT TO SENDER REPLY-TO CC BCC)])") ]
# Run transfer
Set Variable [ $result ; Value: MBS("CURL.Perform"; $curl) ]
# We show results for debugging
Set Variable [ $output ; Value: MBS("CURL.GetResultAsText"; $curl) ]
Set Variable [ $debug ; Value: MBS("CURL.GetDebugAsText"; $curl) ]
Set Variable [ $list ; Value: MBS( "JSON.Colorize";MBS("CURL.GetResultAsEMailList"; $curl)) ]
Set Variable [ $r ; Value: MBS("CURL.Cleanup"; $curl) ]
Set Field [ IMAP Postbox::Log ; $debug ]
Set Field [ IMAP Postbox::JSON ; $list ]

See also

Example Databases

Blog Entries

Release notes

Created 21st December 2018, last changed 27th December 2018


CURL.GetResultAsData   -   CURL.GetResultAsEmail

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos