...

View Full Version : Sending attachments in email



missing-score
01-28-2003, 09: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";

if(mail($to,$subject,$body,$heads)){

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.

Cheers

Explore
01-29-2003, 11:09 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum