Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Text.ReadEMLXFile

Reads email text from emlx file.

Component Version macOS Windows Linux Server iOS SDK
Text 5.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Text.ReadEMLXFile"; FilePath { ; Encoding } )   More

Parameters

Parameter Description Example Flags
FilePath The native file path. Something like "/Users/cs/desktop/test.txt" on Mac and "C:\Programs\Data\test.txt" on Windows. Files without path end in the root directory on Mac. "test.txt"
Encoding The text encoding for result.
Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
UTF8 Optional

Result

Returns text on success and error on failure.

Description

Reads email text from emlx file.
This function provides the raw text from an emlx file as Apple Mail uses them to store emails. You may need to use Text.ReplaceNewline function to change new line characters.
You have to decide which encoding to use (if not native). We support a few encodings, but we can add more if you need something special.

See also Text.ReadTextFile for normal text files and eml files.

Examples

Read email file:

# emlx test in file Contacts

Set Variable [ $path ; Value: "/Users/cs/Desktop/28213.emlx" ]
Set Variable [ $emailSourceText ; Value: MBS( "Text.ReadEMLXFile"; $path; "UTF-8") ]
If [ MBS("IsError") = 0 ]
    Set Variable [ $email ; Value: MBS( "EmailParser.Parse"; $EmailSourceText; "UTF8") ]
    If [ MBS("IsError") = 0 ]
        Show Custom Dialog [ "Email subject" ; MBS( "EmailParser.Subject"; $email ) ]
        Set Variable [ $r ; Value: MBS( "EmailParser.Free"; $email ) ]
    End If
End If

See also

Blog Entries

This function is free to use.

Created 14th September 2015, last changed 4th August 2023


Text.RTFToText - Text.ReadTextFile