Forum Moderators: coopster
There is information on how to do this in the documentation for the mail function [php.net] (See the note about attachments and the comments).
If you receive an email with an attachment and "View Raw Source" in your email application, you can see how the message is structured. (Compare to an email that doesn't have an attachment to see which parts are different.)