I have a form on my website with an attachment option. However, the attachment is not added in the e-mail.
What is wrong with my code?
if (isset($_POST[“submit”])) {
$sql = “SELECT * FROM username WHERE USER = '” . $_POST[“gebruikersnaam”] . “’”;
$result = mysqli_query($conn, $sql);
$found = “”;
while ($row = mysqli_fetch_array($result)) {
$found = $row[“USER”];
}
if ($found != “” && $_POST[""] == “”) { //deze
//login
//echo “Vraag verstuurd”;
$to = "@hotmail.com";
$subject = "VRAAG FCA: " . $_POST[“categorie”];
$message = "gebruikersnaam: " . $_POST[“gebruikersnaam”] . “\r\n” . "Link wachtwoord: " . $_POST[“wachtwoord”] . “\r\n” . "Email van: " . $_POST[“Email”] . “\r\n” . $_POST[“Vraag”];
$headers = ‘From: @hotmail.com’ . “\r\n” . ‘Reply-To:’ .$_POST[“Email”]. ‘’ . “\r\n” . ‘X-Mailer: PHP/’ . phpversion();
mail($to, $subject, $message, $headers);
echo “”;
$_SESSION[“Email”] = $_POST[“Email”]; //deze
//header(“Location: nav.php”);
}
else {
//failed to login
echo “De gebruikersnaam is verkeerd”;
Form code:
">
">
Onderwerp eEntry Link CRM eSales eService Tablet Overige
Bijlage toevoegen
Thank you!