So, here we go with silly question number too many to count!
I've made a very simple PHP contact form using tutorials from the internet (I still need to add security measures to it but I wanted to get it working first) When I click on the send button on my website I do get the message sent script however no email arrives in my in box.
Any ideas what I'm doing wrong? The website is currently hosted locally via XAMPP.
$name = $_POST['name'];
$company = $_POST['company'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$message = $_POST['message'];
$from = 'From: me@mywebsite.co.uk';
$to = 'me@mywebsite.co.uk';
$subject = 'Enquiry';
$body = "From: $name\n Company: $company\n Email: $email\n Telephone: $tel\n Message: $message\n";
if ($_POST['send']) {
if(mail($to, $subject, $body, $from)) {
echo '<p> Your message has been sent!</p>';
} else {
echo '<p>Message could not be sent.<br>Please check that you have completed the name, email and message fields and try again</p>';
}
}