You should probably be including that file as an attachment instead of in the body. According to the Internet Message Format RFC the latest of which is 5322:

There are two limits that this standard places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.

The normal method for content that doesn't have a line length like images is to use MIME boundaries and chunked base64 encoding which all mail clients understand. That is also how attachments are included in emails. If you specify it properly, you can put the whole message in base64 encoded format and completely get around line length problems.

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users.
This could be anything, from a simple guestbook to a e-Money solution. But what…

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP. PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…