Ok I've read through all these forums, and php.net but have not been able to solve this problem. I'm trying to send an image with the mail function but all I've been getting is html text. Can someone point me in the right direction.
Here's what I have:
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
$logo= "--{$mime_boundary}\n";
$logo.="Content-Type: image/gif;\n";
$logo.="name='maillogo.gif'\n"; //Logo image
$logo.="Content-Disposition: inline \n";
$logo.="Content-Transfer-Encoding: base64\n\n";
$logo.=$data . "\n\n";
$logo.="--{$mime_boundary}--\n";
$from="\"$from_name\" <$from_mail>";
$headers="\nMIME-Version: 1.0\n";
$headers.="Content-Type: multipart/mixed; charset='iso-8859-1'\n";
$headers.="From: $from\nX-Mailer: System33r";
$headers.=" boundary=\"{$mime_boundary}\"";
$subject="$from_name recommends this website";
$body=$logo;
$body.="Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$body.="Content-Transfer-Encoding: 7bit\n\n";
$body.="Hello $to_name,\n <b>$from_name</b> requested that we send you this e-mail including this personal message:<br>";
$body.="<font color=$main>$message\n</font>";
$body.="<br>-----<br>\n";
$body.=$signature;
$body.="--{$mime_boundary}\n";
mail($to_mail,$subject,$body,$headers);
Header ("Location: $thank");