« How the Script Merges… | Home | Visualize electronic … »

XDevMag: Parse your Mails in Xojo

Using EmailParser

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.1 issue:

In this article, Stefanie Juchmes provides an introduction to parsing emails using Xojo and the MBS Xojo CURL Plugin. She explains the process of reading and analyzing email content by first obtaining the email in an "eml" file format. This can be done by exporting it from an email application like Apple Mail. The email is then loaded into the program using the MimeEmailMBS class, which can be initialized with different file types such as a MemoryBlock, String, or FolderItem. Once the email is loaded, various properties such as the subject and received date are accessed to extract basic information.

The article goes on to describe how to access more detailed content of the email, including plain text and HTML format, using properties like PlainText and HTMLText. It highlights the role of inline graphics in emails, especially in advertising, and shows how to retrieve information about these graphics using the Inlines property. Each inline graphic is represented by a MimeAttachmentMBS object, and the code allows the user to extract file names and other details. The section also explains how to handle email attachments similarly by accessing the MimeAttachmentMBS objects and determining the file types using the MimeType property.

Finally, the article covers how to analyze the email's header to gather details about the sender, recipients, and other metadata. Using the MimeHeaderMBS class, the article demonstrates how to extract the sender's and recipient's addresses, including the ability to handle multiple addresses in fields like bcc, cc, and to. The StringValue property is used to retrieve these as strings, while the Addresses method provides more detailed information. The article concludes with a suggestion to explore further email features in another article by the author, focusing on sending emails with inline graphics in the headers and footers.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

16 02 25 - 12:00