Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

mailReadMessage – PB Docs 126 – PowerBuilder Library

mailReadMessage – PB Docs 126

mailReadMessage PowerScript function

Description

Opens a mail message whose ID is stored in the mail session’s
message array. You can choose to read the entire message or the
envelope (sender, date received, and so on) only. If a message has
attachments, they are stored in a temporary file. You can also choose
to have the message text written to in a temporary file.

Controls

mailSession object

Syntax

Argument

Description

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
datatype:

  • 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

Return Values

MailReturnCode. Returns one of the following values:

  • mailReturnSuccess!

  • mailReturnFailure!

  • mailReturnInsufficientMemory!

If any argument’s value is null, mailReadMessage returns null.

Usage

To obtain the message IDs for the messages in the user’s
inbox, call mailGetMessages.

Before calling mail functions, you must declare and create
a mailSession object and call mailLogon to establish
a mail session.

note.png Reading attachments

If a message has an attachment and you do not 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.

Examples

In this example, mail is displayed in a window with
a DataWindow dw_inbox that lists mail
messages and a MultiLineEdit mle_note that
displays the message text. Assuming that the application has created
the mailSession object mSes and successfully
logged on, and that dw_inbox contains
a list of mail items (sender, subject, postmark, and message ID);
this script for the Clicked event for dw_inbox displays
the text of the selected message in the MultiLineEdit mle_note:

See mailGetMessages for an example that
creates a list of mail messages in a DataWindow control, the type
of setup that this example expects. See also the mail examples in
the Code Examples sample application supplied with PowerBuilder.

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x