DumpToFile method: MCFInboundEmail class
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
| Parameter | Description |
|---|---|
|
&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", "UTF8");
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;