We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Handling a TNEF mail with only plain-text body

We are using the Aspose.Email product to read .EML files in TNEF content. Very good it is too!
But there is a type of email that should (after tnef conversion) be in plain-text only (not html). But it always shows a blank body (getBody() or getHtmlBody() ). The source files may well have an issue - but nevertheless, I can ‘see’ some content in the binary .dat file when viewed in Notepad - but I cant work out if it includes the plain text or if it is actually broken data.
Is there a way to ‘debug’ the tnef to see if it actually includes the plain text content - or is the aspose library ( MailMessage.load(msgFile) ) showing as much content as it can find? I could share an example file - before I get back to the creator of the .eml files (not using aspose) to tell them that there is an actual fault.

@mbeedell

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input documents.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired behavior.
  • Please create a sample application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi Tahir,

The original mail is a plain-text only mail – a screen shot is below. It has been extracted out of an archive to create this attached TNEF formatted .eml file. However, I am not convinced that the TNEF version maintains the plain text part at all. Could you confirm this?

The Aspose conversion is as simple as this:

MailMessage msg = MailMessage.load(msgFile.absolutePath);

msg.save(emlFile.absolutePath, SaveOptions.getDefaultEml());

NOTE: With this particular case, the aspose output file retains the tnef content type and binary encoding headers – presumably because the actual content was entirely blank.

(Attachment 111490308-plain.eml is missing)

Resent with zipped attachment.

image001.png (19 KB)

111490308-plain.zip (4.49 KB)

@mbeedell

We have logged a ticket for your issue in our issue tracking system as EMAILJAVA-35023. We will inform you via this forum thread once there is an update available on it.

We apologize for your inconvenience.

@mbeedell

It is to inform you that the issue which you are facing is actually not a bug in Aspose.Email. The TNEF content of the source file is corrupted. So, we have closed this issue (EMAILJAVA-35023) as ‘Not a Bug’.

Thank you for trying. Though the test file was readable by jTNEF. The plain text field was in the TNEF data set, as shown below (slightly truncated for this response):

MAPIProp: type=PT_UNICODE_STRING id=PR_BODY value=Hi ,
A user logon has been detected.
Details :
User: FICELNEW\rmt_nouv05
LogonTime : 21/01/2022 09:26:51
Source Network Address: 192.168.11.1
Thank you
IT-SYSTEM

And repeated in a truncated form here:

MAPIProp: type=PT_UNICODE_STRING id=PR_PREVIEW value=Hi ,
A user logon has been detected.

@mbeedell

We have logged this detail in our issue tracking system. We will inform you via this forum thread once there is an update available on it.

Thank you.
I have done a little more research. It seems that Plain Text mails should hold the body content in a TNEF “Attribute” value and not a “Property”. However, if the PR_BODY (0X1000) Property is used when the normal Attribute (body 0x800C) is missing, then the plain text will be included in the converted output mail.
Again - I do not believe this to be a fault with Aspose. But we have rather a lot of these items and just need a way to convert them as best as we can.
So thank you for anything that you are able to do.

@mbeedell

Thanks for sharing the detail. We have added this information in ticket EMAILJAVA-35023. We will be sure to inform you once there is an update available on it.

I saw that you had a new release of aspose Mail for Java - with the fix for Plain Text. I can confirm that it worked on all of the problem cases.
Thank you very much.

@mbeedell

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Email, we will be happy to help you.