Click to See Complete Forum and Search --> : Send an attachment with an email


k0r54
10-07-2004, 07:43 AM
Hi,

I am wondering how i can send attatchments with my email. (dont worry im sending viruses :p )

I do my email like this


//body of the email
$msg = "Hi $_POST[name]\n";
$msg .= "** This is an automated email**\n";
$msg .= "\n";
$msg .= "blah blah blah.\n";
$msg .= "blah blah blah.\n";
$msg .= "\n";

//headers
$recipient = "blah@apc-compunet.co.uk";
$subject = "Problem blah blah";
$mailheaders = "From: blah<blah@apc-compunet.co.uk> \n";
$mailheaders = "Reply-To: blah@apc-compunet.co.uk";

//Send mail
mail($recipient, $subject, $msg, $mailheaders);


The files will be on my server with the php file

Thanks Adam

yuna
10-07-2004, 07:49 AM
You need to construct a multi-part MIME-encoded email. See http://www.zend.com/zend/spotlight/sendmimeemailpart1.php for details.