Hey guys. So I have a very simple contact form that wont send emails. Here is the link:
http://brand32.com/clients/dark_water_media/Dark/contact.html
Upon clicking “Send”, the page displays “Your message has been sent successfully!”, but no email is ever received. I’ve changed the email address in the php multiple times but nothing.
Here is the code:
[php]
<?php
$receiverMail = "
[email protected]"; /* Your email */
$name = ltrim(rtrim(strip_tags(stripslashes($_POST['name']))));
$email = ltrim(rtrim(strip_tags(stripslashes($_POST['email']))));
$website = ltrim(rtrim(strip_tags(stripslashes($_POST['website']))));
$msg = ltrim(rtrim(strip_tags($_POST['msg'])));
$subject = $name ." - ".$website;
$ip = getenv("REMOTE_ADDR");
$msgformat = "From: $name ($ip)\nEmail: $email\n\n$msg"; /* MSG format */
// VALIDATION
if(empty($name) || empty($email) || empty($website) || empty($msg)) {
echo "
The email was not sent. Please fill all the required fields
";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
echo "
The email was not sent. The email address is invalid
";
}
else {
mail($receiverMail, $subject, $msgformat, "From: $name <$email>");
echo "
Your message has been sent successfully!
[/php]