Hi Guys, I am trying to make a form that will email an attachment. Any ideas what I'm doing wrong here?
--form.php--
<form action="submit.php" method="post" enctype="multipart/form-data">
<textarea name="msg">Insert Msg</textarea>
<input type="file" size="38" name="new_file">
<input type="submit" value="send file">
</form>
--submit.php--
<?php
$headers = "From: test@server.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("TEST");
$headers .= "Content-Type: multipart/alternative; boundary = $boundary\r\n";
$headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "$msg\r\n";
$headers .= "Content-Type:text/html;name=Test.html\r\n";
$headers .= "Content-Transfer-Encoding:8bit\r\n";
$headers .= "Content-Disposition: attachment\r\n";
$headers .= "$new_file\r\n";
$headers .= "--$boundary\r\n";
mail("me@here.com", "subject", "", $headers);
?>
Any help you guys can give would be great.. Thanks,
-Drumstin