I host my website on a PaaS-modeled, shared hosting environment by a well known hosting provider (SiteGround) with which I never had trouble send emails to myself from contact forms in various CMSs.
I am trying to create a CMS-agnostic contact form by myself; I can submit forms with the follownig PHP code and there are no PHP errors in the browser or in an automatically-generated log file and yet no email reaches to my inbox or spam.
Is there any problem with the code?
<?php
$name = $_POST["name"];
$email = $_POST["email"];
$phone = $_POST["phone"];
$topic = $_POST["topic"];
$date = $_POST["date"];
$time = $_POST["time"];
$notes = $_POST["notes"];
$to = "example@example.com"; ########## !!! NOTE !!! ##########
$subject = "הודעת יצירת קשר";
$message = array (
$name . "שם" . "\r\n",
$email . "אימייל" . "\r\n",
$phone . "טלפון" . "\r\n",
$topic . "פנייה בנושא" . "\r\n",
$date . "יום רצוי לפגישה (אם יש)" . "\r\n",
$time . "שעה רצויה לפגישה (אם יש)" . "\r\n",
$notes . "הערות (אם יש)" . "\r\n"
);
$headers = array(
"From" => $email,
"Reply-To" => $email,
"X-Mailer: PHP/" . phpversion()
);
# The order should be as above: $to, $subject, $message and $headers
mail($to, $subject, $message, $headers);
?>