1

I am using ColdFusion to build a CSV file and then sending it as an email attachment to a user.

I copy myself on the emails, receive the attachment as a CSV file, in both Gmail and Outlook, and can open the attachment as a CSV file in Microsoft Excel.

I am attaching the file using the CFMAILPARAM tag. I have tried sending it two ways:

<cfmailparam file="C:/temp/myfile.csv" type="text/plain" />

This results in the user seeing a .txt file. When I receive the email, the Header reads:

Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename*=myfile.csv

Using:

<cfmailparam file="C:/temp/myfile.csv" type="text/csv" />

This results in the user seeing a .dat file, which they cannot open in Microsoft Excel. When I receive the email, the Header reads:

Content-Type: text/csv
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename*=myfile.csv

Any idea what's going on here?

Nikita Silverstruk
  • 1,097
  • 1
  • 20
  • 42
Eric Belair
  • 10,574
  • 13
  • 75
  • 116

4 Answers4

4

Are you sending the messages outbound through a Microsoft Exchange server and are the Lotus Notes recipients seeing it as a winmail.dat file? If so, then the problem is that the mail server you are sending your messages through is configured to send in TNEF format instead of native MIME to external recipients. TNEF is a Microsoft format, not a standard, though many mail servers do convert it properly -- which would explain why gmail recipients are not having the problem. Up to date Lotus Domino versions can also convert it, but might not have the feature configured.

See this MS Knowledge Base article to prevent it on the sending side and/or this IBM Tech Note to turn on a feature on the Domino server that decodes the TNEF on the inbound side.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
  • Good answer but it trips me up that the text/csv MIME type come through correctly without the .dat file conversion. – Mark A Kruger May 23 '12 at 19:12
  • I'm not an Exchange expert (in fact, I know very little about it), but there's a possibility that it is splitting the message and sending different formats to different recipients. The definitive thing that you want to know is what the Domino server is seeing in the MIME. Unfortunately, that info might be hard to get. If the Lotus Notes user is configured to receive his mail in Notes format, it will go through a conversion before it is deposited in his mailbox. If he is configured to receive in MIME format, though, he should receive it unaltered and should be able to view the MIME source. – Richard Schwartz May 24 '12 at 01:50
  • I'll look into this. Unfortunately, I have no control over the end users' Lotus configurations. The odd thing is that other users at the same company are receiving other CSV files with no problem. – Eric Belair May 25 '12 at 19:54
  • I was not citing the end user's config as being the problem or the thing you need to fix. I was citing it just to let you know that some end user configurations will allow you to see what the incoming MIME looked like, and some won't. If there's at least one user whose configuration specifies that he receives messages in MIME format, that's helpful. If there isn't, the only way you could look at the incoming MIME would be by turning on debug settings on the Domino server (described here: http://www-304.ibm.com/support/docview.wss?uid=swg27003007). I suspect you will find TNEF in the MIME. – Richard Schwartz May 25 '12 at 21:51
1

It turns out the solution was very very simple. The files being sent had spaces in the file name. When I removed the spaces from the file names, the files were received normally.

Eric Belair
  • 10,574
  • 13
  • 75
  • 116
0

Is the DAT file UUEncoded? If so your issue may be related to this.

http://support.microsoft.com/default.aspx?scid=KB;en-us;q138053

There was an OpenNTF project some years ago that allowed you to read the DAT files.

http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/WinmailExtractor

Simon O'Doherty
  • 9,259
  • 3
  • 26
  • 54
0

Ask the Domino administrator to add the following to the notes.ini on the mail server:

TNEFEnableConversion=1

This will make sure that Domino can process emails sent by an Exchange server, and are encapsulated in MS TNEF format.

Jeroen Jacobs
  • 1,423
  • 3
  • 16
  • 32