Email with attachment

$file = $path.$filename; $content = file_get_contents( $file); $content = chunk_split(base64_encode($content)); $uid = md5(uniqid(time())); $name = basename($file); // header $header = “From: “.$from_name.” <“.$from_mail.”>\r\n”; $header .= “Reply-To: “.$replyto.”\r\n”; $header .= “MIME-Version: 1.0\r\n”; $header .= “Content-Type: multipart/mixed; boundary=\””.$uid.”\”\r\n\r\n”; // message & attachment $nmessage = “–“.$uid.”\r\n”; $nmessage .= “Content-type:text/plain; charset=iso-8859-1\r\n”; $nmessage .= “Content-Transfer-Encoding: 7bit\r\n\r\n”; $nmessage .= $message.”\r\n\r\n”; $nmessage … Read moreEmail with attachment