I am trying to have a php mailer code attach a file along with the regular information. I don’t know what to do. Here is how far I have come.
Form.html
<form method="post" name="contact" action="contactprocessor.php">
<label for="name">Name: </label> <input type="text" id="name">
<label for="email">email: </label> <input type="email" id="email">
<label for="file">Upload file: </label> <input type="file" id="file">
<input type="submit" id="name" value="upload">
contactprocessor.php
<?php
$emailSubject = 'file upload';
$mailto ='me@mymail.com';
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$body = <<<EOD
NAME: $name <br>
Email: $email <br>
EOD;
$headers = "from: $email\r\n";
$success = mail($mailto, $emailSubject, $body, $headers);
?>
Unfortunately, you can’t send file with email directly. I recommend to use phpmailer class (http://code.google.com/a/apache-extras.org/p/phpmailer/) but also there is a traditional way: http://webcheatsheet.com/php/send_email_text_html_attachment.php