The below code sends an email. However the problem is that it also sends an attachment. If I change certain content-transfer or encoding properties in the code to take out the attachment, I get weird encoding numbers in my email..
Like so: --236BFDCA621946713A904CF72FC719E7 Content-Type: text/html Content-Transfer-Encoding: 8bit
How can I take this out, I do not want attachments.
function sendmsg($to, $subject, $text, $from) {
/ $content = fread(fopen($file,"r"),filesize($file));
$content = chunk_split(base64_encode($content)); /
$uid = strtoupper(md5(uniqid(time())));
/ $name = basename($file); /
$header = "From: $from\nReply-To: $from\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; boundary=$uid\n";
$header .= "--$uid\n";
$header .= "Content-Type: text/html\n";
$header .= "Content-Transfer-Encoding: 8bit\n\n";
$header .= "$text\n";
$header .= "--$uid\n";
/ $header .= "Content-Type: $type; name=\"$name\"\n"; /
$header .= "Content-Transfer-Encoding: base64\n";
$header .= "$content\n";
$header .= "--$uid--";
mail($to, $subject, "", $header);
return true;
}
Thank You in advance