mailsession.mailReadMessage ( messageid, mailmessage, readoption, mark )
mailsession A mailSession object identifying the session in which you want to read a message
messageid A string whose value is the ID of the mail message you want to read
mailmessage A mailMessage structure in which mailReadMessage stores the message information
readoption A value of the mailReadOption enumerated data type:¨ mailEntireMessage! — Obtain header, text, and attachments¨ mailEnvelopeOnly! — Obtain header information only¨ mailBodyAsFile! — Obtain header, text, and attachments, and treat the message text as the first attachment, storing it in a temporary file¨ mailSuppressAttachments! — Obtain header and text, but no attachments
mark A boolean indicating whether you want to mark the message as read in the user's inbox. Values are:¨ TRUE — Mark the message as read¨ FALSE — Do not mark the message as read
MailReturnCode. Returns one of the following values:
If any argument's value is NULL, mailReadMessage returns NULL.
To obtain the message IDs for the messages in the user's inbox, call mailGetMessages.
Reading attachments If a message has an attachment and you don't suppress attachments, information about it is stored in the AttachmentFile property of the mailMessage object. The AttachmentFile property is a mailFileDescription object. Its PathName property has the location of the temporary file that mailReadMessage created for the attachment. By default, the temporary file is in the directory specified by the TEMP environment variable.
Be sure to delete this temporary file when you no longer need it.
Before calling mail functions, you must declare and create a mailSession object and call mailLogon to establish a mail session.