View Full Version : Sending attachments in email

01-28-2003, 10:00 PM
Does anyone know how to add an attachment to an email that can be sent with the mail() function. This is what I tried:

$to = "matt@missingscore.co.uk";
$subject = "Attachment Test";
$body = "Is there an attachment?";
$heads = "From: myself@missingscore.co.uk\nAttachments: myfile.gif\n";


echo "Message Sent";

} else {

echo "Error in sending";


It sends the email, but no from or attachments appear on the email.

Any help would be appreciated.

P.S: Also, if anyone has any good links to file uploaders, could you post them.


01-29-2003, 12:09 PM
To attach files to email messages you'll have to define the message body to be a multipart mime message.

Here (http://forums.devshed.com/showthread.php?threadid=25979) are some links and examples.