Email with Attachments

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.

Listing 18.5. Sending a Tab-Delimited Excel File
						
							
								
							
						
					

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 ...

Get Core PHP Programming: Using PHP to Build Dynamic Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.