I have an application that reads emails from a mailbox and after a business rule (saves original attachments on disk and creates a unique sequence number), the app sends a reply to the sender (with the attachments and the unique number back).

There´s a problem when the original email comes with a winmail.dat... all attachments are not sent back, only the message with the number.

I would like to know if there´s a workaround for the OutSystems built-in component to send emails with attachments correctly, even when there´s a winmail.dat.

I saw that the problem can be on user side ( but in my scenario it´s impossible to ask people to configure their email tool.

Is there anybody out there that experienced the same issue?

Thank you!!
Hi Carolina,

From what you describe I would say that the problem is on your application side or on getting the attachments from the original email.
What exactly are you using to read and send the emails?

João Rosado

To retrieve the emails I use the RichMail extension > Pop3GetEmails. Then I do a loop (GetEmails.OutEmails)  and save the attachments on the disk.
To send emails I use the built-in widget SendEmail

 Action GetEmails 

And for the attachments, on SendEmail Preparation, I go to the server folder and retrieve the files.
(I skip winmail.dat)

Hi Carolina,

Well, the logic looks ok on the screenshots.
Maybe the conditions on those 2 if's? If you place an audit audit on the False branch, it gets called?
Also, if you don't skip the .dat, does it work correctly?

João Rosado
The first IF checks if the file size > 0 and the second if it is a .dat file.
If I don´t skip the winmail.dat, then the email is sent but without attachments.
Directory_ListDirFiles.FileList.Current.File.Size > 0

Index(Directory_ListDirFiles.FileList.Current.File.Name,".dat") > -1 

I don't think that it's a problem in the platform, since we don't look into the attachments at all.

My next guess is that the problem is somewhere in the middle. Most email servers, antivirus and firewalls are known to block that file.
I think your server (or something in the middle) is messing your email in the process.

João Rosado
Winmail.dat has cause one of my clients a great deal of frustration!!!

A winmail.dat file will occour when a a rich email type is sent with attachments to an apple based email client system. The client has trouble determining what is part of the email and what is part of the atachment, and thus put the entire content of the rich contecnt (imbedded pictures, attacthemnts etc) into a single winmail.dat file.

It was occuring for my client becuase they have a rich email signature that consists of images. When they were sending emails with attachments to an apple based email client, they would all be "zipped" into a winmail.dat file.

Possible wordaround:
Make sure you send your email as palin text. Not Rich or HTML based. This has worked for me.
Hi Carolina,

The problem isn't with the platform not handling correctly email messages when a winmail.dat file is present. When winmail.dat is present, it means that the mail message was sent from an Outlook client using a proprietary format from Microsoft, which is non-standard and will result in issues when opening email on other mail clients (including, but not limited to, the OutSystems platform). It will also mean that the attachments will likely be inside winmail.dat and accessing them requires extracting them.

This proprietary format is known as TNEF and there are a number of tools and plugins for non-outlook mail clients for extracting the contents from the winmail.dat archive. You can find a comprehensive list in the wikipedia page for TNEF.

So, in order to handle winmail.dat archives, there are two possibilities:
  • creating an extension that uses one of the extraction programs
  • creation an extension that implements the extraction itself
Unfortunately I can't help you further with this issue, especially because I don't have a winmail.dat file I can use for any testing, but if you have any trouble or need any assistance with implementing one of those solutions, please tell us.