Sending plain email with PHP is easy. The mail function handles all the messy protocol details behind the scenes. But if you want to send attachments, you will need to dig into an RFC, specifically RFC 1341. This RFC describes MIME, Multipurpose Internet Mail Extensions. You can read it at the faqs.org site <http://www.faqs.org/rfcs/rfc1341.html>, but I'll show you a somewhat naòve implementation.
There are several example implementations to be found on the Web. Check out David Sklar's networking section <http://px.sklar.com/section. html?section_id=10>. Most of these put ...