Retrieves a message from the POP3 mailbox.
o.GetMessage(lvMessage)
Return Value
Message Object or NULL
Parameters
lvMessage
The message to retrieve:
Message Number - integer
Message Id - String
Value can be either a message number (ie. Message one of the current mail session) or a Message ID which comes from the SMTP header. The Message ID can be retrieved from a message header with loMsg.cMsgID and should be used for disconnected front ends.
Message numbers are much faster since they simply go to the message in the current POP 3 stack, but these values can be unreliable if the mail server is accessed in a disconnected fashion as there's no guarantee it will return the message list in the same order. This is a common scenario for Web front ends that connect to get a message list, then connect again to retrieve the message. In this scenario the list should link to the MsgId and then retrieve the message with that id.
Remarks
Message is not deleted after retrieval.
Example
loPOP = CREATEOBJECT("wwPOP3") loPop.cMailServer = "yourmailserver.com" loPop.cUserName = "ricks" loPop.cPassword = "password" *** Create a log string loPop.lLogSession = .T. ? loPOP.Connect() *** Retrieve a single message (1st) from server loMsg = loPop.Getmessage(1) IF ISNULL(loMsg) RETURN ENDIF *** Do whatever you need with the message ? loMsg.cSubject, loMsg.cFromName, loMsg.nSize
See also:
Class wwPOP3 | wwPOP3::GetMessage© West Wind Technologies, 2024 • Updated: 07/13/02
Comment or report problem with topic