Sending email attachments

An example of how to send Text & HTML email with an attachment.


 
--PHP-mixed-  
Content-Type: multipart/alternative; boundary="PHP-alt-" 

--PHP-alt-  
Content-Type: text/plain; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit

Hello World!!! 
This is simple text email message. 

--PHP-alt-  
Content-Type: text/html; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit

Hello World!

This is something with HTML formatting.

--PHP-alt--- --PHP-mixed- Content-Type: application/zip; name="attachment.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment --PHP-mixed---