$filename = "logo.gif";
$fh = fopen($filename, "rb");
$filecontent = fread($fh, filesize($filename));
fclose($fh);
$mess = chunk_split(base64_encode($filecontent));
$to = "
[email protected]";
$subj = "отправка изображения в качестве вложения";
$headers = "Content-disposition: attachment; filename=logo.gif\n";
$headers. = "Content-type: image/gif\n";
$headers. = "Content-Transfer-Encoding: base64\n";
mail($to, $subj, $mess, $headers);