<?php
function sendmsg( $to, $subject, $text, $from ) {
$content = fread( fopen( "logo.gif", "r" ), filesize( "logo.gif" ) );
$content = chunk_split( base64_encode( $content ) );
$boundary = strtoupper( md5( uniqid( time() ) ) );
$name = basename( $file );
//***************************************************************
$header = "From: $from\n";
$header .= "Reply-To: $from\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/mixed; boundary=".$boundary."\n";
$header .= "--".$boundary."\n";
//***************************************************************
$header .= "Content-Type: text/html\n";
$header .= "Content-Transfer-Encoding: 8bit\n\n";
$header .= $text."\n";
$header .= "--".$boundary."\n";
//***************************************************************
$header .= "Content-Type: image/gif; name=\"logo.gif\"\n";
$header .= "Content-Transfer-Encoding: base64\n";
$header .= "Content-ID: <some_picture>\n\n";
$header .= $content."\n";
$header .= "--".$boundary."--";
//***************************************************************
mail( $to, $subject, "", $header );
return true;
}
?>