Below is the full code of my form processing PHP page:
$success = false;
if (isset($_POST['name'])) {
$name = $database->clean_input( $_POST['name'] );
$company = $database->clean_input( $_POST['company'] );
$email = $database->clean_input( $_POST['email'] );
$phone = $database->clean_input( $_POST['phone'] );
$content = $database->clean_input( $_POST['content'] );
$database->query(" INSERT INTO messages (name,company,email,phone,content) VALUES ('" . $name . "', '" . $company . "','" . $email . "', '" . $phone . "', '" . $content . "') ");
$message = 'FROM: ' . $name . '\r\n\r\nCOMPANY: ' . $company . '\r\n\r\nEMAIL: ' . $email . '\r\n\r\nPHONE: ' . $phone . '\r\n\r\nCONTENT: ' . $content;
$message = wordwrap($message, 70, "\r\n");
$headers = 'From: no-reply@censored.com' . "\r\n" .
'Reply-To: contact@censored.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(@mail('me@censored.com', 'censored.com message from ' . $name, $message, $headers)) {
$success = true;
}
else
echo '<p>Error: Your request could unfortunately not be processed, please use another contact method or try again later.</p>';
}
After this is executed, $success = true;
so it seems the mail was successfully sent, but 20mins later I've still received nothing in my inbox.
I used I the same code on a live site in the past and it did work. I'm now running this on localhost
with XAMPP and I'm wondering if it's not a config issue.
I'm a bit lost how to debug this further tbh.
EDIT:
I'm using the latest version of XAMPP and running on Mac OS X