Command POP3_DownLoad

4D Internet Commands

POP3_DownLoad

version 6.5


POP3_DownLoad (pop3_ID; msgNumber; headerOnly; fileName) Integer

ParameterTypeDescription
pop3_IDLongintReference to a POP3 login
msgNumberLongintMessage number
headerOnlyInteger0 = Entire message, 1 = Only header
fileNameTextLocal Filename
Resulting Local Filename

Function result Integer Error Code

Description

The POP3_DownLoad command is designed to retrieve a message from a POP3 server by downloading it to a disk-based file. Any POP3 message which contains attachments or whose size is greater than 32K should be downloaded with this command. Attachments to a message can only be extracted from messages retrieved in this way.

pop3_ID is a long integer reference to an open session created with POP3_Login.

msgNumber is a long integer value indicating which message in the mailbox to retrieve. The msgNumber represents the position of a message within the current list of messages. You cannot rely on the msgNumber remaining the same for a specific e-mail item from session to session.

headerOnly is an integer value which denotes whether to retrieve the entire contents of the message or just the header information.

fileName contains the name of the file and the optional path where you would like the message saved. This value may be specified three different ways:

""= Saves the file in the folder set by POP3_SetPrefs, with the name "temp1" (if a
file with the same name already exists, the filenames "temp2", "temp3", etc.
will be tried until an unused file name is found)
"FileName"= Saves the file in the folder set by POP3_SetPrefs, titled fileName
"Path:FileName"= Saves the file in the path specified with the name fileName

In the first two cases, if no folder has been specified by POP3_SetPrefs, the message will be saved in the same folder as the structure of the database (with 4D single-user) or in the 4D Client folder (with 4D Server). After the file has been saved to disk, the final name of the file will be returned to the variable passed as the fileName parameter. If you attempt to call POP3_Download with a fileName that already exists within the download folder, the name will be numerically incremented and its new value as saved to disk will be returned to the fileName variable.

See Also

POP3_SetPrefs.