Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.GetResultAsEMailList

Parses result of an IMAP list query.

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

Parameters

Parameter Description Example
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.com/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.GetDebugMessages"; $curl) ]
Set Variable [ $list ; Value: MBS( "JSON.Colorize";MBS("CURL.GetResultAsEMailList"; $curl)) ]
Set Variable [ $r ; Value: MBS("CURL.Release"; $curl) ]
Set Field [ IMAP Postbox::Log ; $debug ]
Set Field [ IMAP Postbox::JSON ; $list ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 21st December 2018, last changed 4th March 2023


CURL.GetResultAsData - CURL.GetResultAsEmail