The reason you only get the message some of the time is that you get different kinds of attachments. File types are identified by their extension--the 3 or 4 characters at the end of their file name, after the dot.
To open an attachment, you have an appropriate program installed for that type of file. So, here are a few examples:
A .doc or .docx file requires Microsoft Word, or some compatible program.
An .xls or .xlsx file requires Microsoft Excel, or some compatible program.
A .wpd file requires WordPerfect or some compatible program.
A .pdf file requires a pdf reader, (of which there are several).
So at least some of the time, you apparently get attachments for which you don't have an appropriate program installed. Tell us the extensions of those attachment's names, and I or someone else here can tell you what program you need to install to open it.