KevinM1 Posted June 27, 2010 Share Posted June 27, 2010 I have the following quick and dirty contact form script: <?php ini_set('display_errors', 1); error_reporting(E_ALL); if (isset($_POST['submit'])) { if (isset($_POST['name']) && !empty($_POST['name'])) { if (preg_match("/^[A-Z\-' ]+$/i", $_POST['name'])) { $name = $_POST['name']; } else { $name = false; } } else { $name = false; } if (isset($_POST['email']) && !empty($_POST['email'])) { if (preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i", $_POST['email'])) { $email = $_POST['email']; } else { $email = false; } } else { $email = false; } $message = htmlentities(trim($_POST['message']), ENT_QUOTES, "utf-8"); $message = "Email Address of user: $email<br /><br />Message:<br />$message"; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n"; if ($name && $email) { if (mail("*******", "Major Productions Inquery From $email", $message, $headers)) { header("Location: success.html"); exit; } else { header("Location: failure.html"); exit; } } else { header("Location: failure.html"); exit; } } else { header("Location: home.html"); exit; } ?> For some reason, mail is failing. Error reporting shows nothing when I remove the header redirects. Anything jump out as being wrong? The headers, perhaps? I'm thinking it's something with the shared hosting I'm on, but want to verify I didn't do something dumb before submitting a ticket to them. Link to comment https://forums.phpfreaks.com/topic/205998-mail-problems/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 27, 2010 Share Posted June 27, 2010 Are any functions disabled in the master php.ini, such as ini_set() or mail()? Link to comment https://forums.phpfreaks.com/topic/205998-mail-problems/#findComment-1077923 Share on other sites More sharing options...
KevinM1 Posted June 27, 2010 Author Share Posted June 27, 2010 Are any functions disabled in the master php.ini, such as ini_set() or mail()? I don't have access to the master, so I'm not sure. Link to comment https://forums.phpfreaks.com/topic/205998-mail-problems/#findComment-1077924 Share on other sites More sharing options...
KevinM1 Posted June 27, 2010 Author Share Posted June 27, 2010 After digging through the fine print, there is no mail functionality with my flavor of shared hosting. D'oh! Link to comment https://forums.phpfreaks.com/topic/205998-mail-problems/#findComment-1077933 Share on other sites More sharing options...
PFMaBiSmAd Posted June 27, 2010 Share Posted June 27, 2010 I don't have access to the master, so I'm not sure. phpinfo()? Link to comment https://forums.phpfreaks.com/topic/205998-mail-problems/#findComment-1077936 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.