0

I have a small php form where I want to be able to upload a document and then have it sent to my email. I have looked all over and I cant find anything that helps me. Below is the code that I have to retrieve the information from my form and email it, but I don't know how to include the file and send it as an attachment. Any help would be greatly appreciated.

<body>
<?php
  $name=addslashes($_POST['name']);
  $Email=addslashes($_POST['email']);
  $number=addslashes($_POST['number']);




  $toemail = "email@email.com";
  $subject = "Submission website";

  $headers = "MIME-Version: 1.0\n"
            ."From: \"".$name."\" <".$Email.">\n"
            ."Content-type: text/html; charset=iso-8859-1\n";

  $body = "Name: ".$name."<br>\n"
            ."Email: ".$Email."<br>\n"
            ."Phone: ".$number."<br>\n"
            ."Message: ".$message."<br>\n";






    mail($toemail, $subject, $body, $headers);

?>
</body>
</html>
user2048564
  • 41
  • 1
  • 1
  • 2

0 Answers0