Reviewing the headers of these messages, the text of the SMS appears as plain text immediately after the blank line delimiting the message body from the headers.
The header section include these lines:
Code: Select all
Content-Type: text/plain; name="text_0.txt" Content-Transfer-Encoding: 7bit Content-ID: <0> Content-Disposition: attachment; filename="text_0.txt"
The hMailServer API doesn't provide a way to access an attachment's contents directly, so I'd have to save the attachment to a temporary file, read the contents, append that text to the Message.Body, and delete the temporary file. Seems like an inelegant way to handle the conversion.
I'd prefer to read the attachment text directly from the message content but I don't see a method or property that gives me access all sections of the message as string data without reading the message file from disk.
Any other ideas?