我有一个小的PHP表单,我希望能够上传文档,然后将其发送到我的电子邮件。我看了一遍,我找不到任何有帮助我的东西。下面是我必须从表单中检索信息并通过电子邮件发送的代码,但我不知道如何包含该文件并将其作为附件发送。任何帮助将不胜感激。
<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>