ATT00000.txt files in Outlook

This information is for people who create email messages in programming languages, not Outlook users.

The separator (defined in the Content-Type header) is used to start a new part of the multipart MIME message. Standard practice (not sure if it’s RFC behaviour or not) is to place an instance of the separator at the end of the message. Outlook sees this as the start of a new attachment. Because it has no Content-Disposition information it names it automatically, and of course there’s no content so it’s an empty file. So by not placing the separator at the end of the message, you avoid the empty attachment.

Searching for the answer today I have seen loads of people asking about this online, nobody came up with an answer. Part of the problem is the frequency with which Outlook generates these ATT*.txt files; some people were seeing their attachments replaced with these empty text files, some were getting blank email bodies, but with attachments and the empty text files, etc.

This just came to me after spending the day trying to figure it out, and it works. The logic of the first paragraph is entirely guesswork on my part.