CFLEmlReader Procedure

  • 2 minutes to read

Codeunit CFL E-mail Reader

Reads and parses an EML file (standard email format) into a JSON object. Extracts sender information, recipients, subject, body content, and attachments. Note: EML files may not contain receiver name information, which will be returned as NULL.

Signature

CFLEmlReader(Base64EmlFile: text) MailJson: JsonObject

Parameters

Base64EmlFile text

Base64 encoded string of the EML file.

Returns

JsonObject

A JSON object containing the parsed email data with sender, receiver, recipients, subject, importance, body (text and HTML), and attachments.

Example

Response format: { "Sender": {"Name": "John Doe", "Email": "john@example.com", "SentOn": "2023-05-26T15:58:01+00:00"}, "Receiver": {"Name": "NULL", "Email": "NULL", "ReceivedOn": "2023-05-26T15:58:12.8624673+00:00"}, "Recipients": [{"Name": "Jane Smith", "Email": "jane@example.com", "Type": "To"}], "Subject": "Meeting Request", "Importance": "Normal", "Body": {"Text": "Plain text body", "HTML": "HTML body content"}, "Attachments": [{"filename": "document.pdf", "data": "base64encodeddata"}] }