Apologies if this isnt a php issue im not 100% sure but i noticed that when i send an email from a form on my site it shows up that its from “web user” and a question mark
is there anyway to change this?
<?php
/* Set e-mail recipient */
$myemail = "me@example.com, another@example.com";//"YOUR EMAIL ADDRESS";
/* Check all form inputs using check_input function */
$name = check_input($_POST['name'], "Enter your name");
$email = check_input($_POST['email']);
$message = check_input($_POST['message'], "Write your message");
/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("E-mail address not valid");
}
/* Let's prepare the message for the e-mail */
$message = "
Name: $name
E-mail: $email
Message:
$message
";
/* Send the message using mail() function */
mail($myemail, "AllenTrey Prod.", $message);
/* Redirect visitor to the thank you page */
header('Location: contact.html');
exit();
/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<p>Please correct the following error:</p>
<strong><?php echo $myError; ?></strong>
<p>Hit the back button and try again</p>
</body>
</html>
<?php
exit();
}
?>