MCFInboundEmail Class Methods

In this section, we discuss the MCFInboundEmail class methods. The methods are described in alphabetical order.

Syntax

DumpToFile(&File)

Description

Use the DumpToFile method to write information from the email to an already instantiated file.

This method copies the information from the following email properties, placing each on a separate line:

  • ContentType

  • IsAttachment

  • AttachmentURL

  • Text

Whether the information is appended to the bottom of the file or if it overwrites the file depends on how you instantiated the file object.

Parameters

Field or Control

Definition

&File

Specify an already instantiated file object that you want to write the email data to.

Returns

None.

Example

Local File &BI_FILE;
&BI_FILE = GetFile("mcfdata.out", "w", "a");

Local PT_MCF_MAIL:MCFGetMail &gm;
Local number &ret_status, &nemails, &i;
&gm = create PT_MCF_MAIL:MCFGetMail();

Local array of PT_MCF_MAIL:MCFInboundEmail &emails;
&gm.SetMCFEmail(&user, &password, &server, &ibnode);

&emails = &gm.ReadEmails(0);
If (&gm.StatusCheck(&BI_FILE) = False) Then
   Return;
End-If;

&nemails = &emails.Len;
&ret_status = &gm.Status;
If &nemails > 0 Then
   For &i = 1 To &nemails
      &BI_FILE.WriteLine(MsgGetText(162, 1615, "Message Not Found", &i));
      &emails [&i].DumpToFile(&BI_FILE);   
   End-For;
End-If;

Syntax

GetAttachments()

Description

Use the GetAttachments method to return the attachments with this email.

Parameters

None.

Returns

An array of MCFBodyPart objects. The methods returns an array of length 0 if there are no attachments

Syntax

GetFrom()

Description

Use the GetFrom method to split the semicolon delimited list of addresses in the From property into an array of addresses.

Parameters

None.

Returns

An array of string. Each item in the array contains an email address.

Syntax

GetParts()

Description

Use the GetParts method to return all of this email's parts.

Parameters

None.

Returns

An array of MCFBodyPart objects.

Syntax

GetSender()

Description

Use the GetSender method to split the semicolon delimited list of addresses in the Sender property into an array of addresses.

Parameters

None.

Returns

An array of string.

Syntax

ReadFromDatabase(Email_ID)

Description

Use the ReadFromDatabase method to load a saved email from the database into this instance of email.

Parameters

Field or Control

Definition

Email_ID

Specify the ID of the email, as a number.

Returns

A Boolean: true if the email is restored successfully, false otherwise.

Syntax

SaveToDatabase()

Description

Use the SaveToDatabase method to save this instance of email to the database.

Parameters

None.

Returns

A number, representing the email_ID of the saved email.