POP3RecvHeaders

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO All

Syntax

POP3RecvHeaders (socket,messagenumber,headers[,stsproc]) Returns status

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This Web command is multi-threaded, allowing another thread to execute in the multi-threaded server while it runs. Note that the same socket cannot safely be used concurrently by more than one thread.

POP3RecvHeaders reads the message headers for a message stored on a POP3 server. The message must not be marked for deletion.

Socket is an Omnis Long Integer field containing a socket opened to a POP3 server using POP3Connect.

MessageNumber is an Omnis Long Integer field which identifies the message for which the headers are to be read. Message numbers are assigned by the POP3 server, after you call POP3Connect, starting with 1 for the first message, 2 for the second, and so on.

Headers is an Omnis Binary or Character field which receives the headers for the specified message. Note that you can pass the result to MailSplit, in order to parse the headers. When calling MailSplit, pass an empty list variable as the body argument. For correct results with many of the encodings supported by MailSplit you must receive into a Binary field.

StsProc is an optional parameter containing the name of an Omnis method that POP3RecvHeaders calls with status messages. POP3RecvHeaders calls the method with no parameters, and the status information in the variable #S1. The status information logs protocol messages exchanged on the connection to the server.

Status is an Omnis Long Integer field which receives the result of executing the command. Possible error codes are listed in the Web Command Error Codes Appendix.

Note

POP3RecvHeaders uses an optional POP3 protocol command, so that it may not work with all POP3 servers.

Example

; Read the header for the first message stored on the POP3 server
; lServer for user lUserName
Calculate lServer as 'my.pop3.server'
Calculate lUserName as 'myusername'
Calculate lPassword as 'mypassword'
POP3Connect (lServer,lUserName,lPassword) Returns iSocket
POP3RecvHeaders (iSocket,1,lHeaders) Returns lStatus