contact.php form help cant receive email

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Wed Aug 01, 2012 5:06 pm

contact.php form help cant receive email

Postby aadil7 » Wed Aug 01, 2012 5:11 pm

Hello everyone
I have a website where I have a contact form and I am not getting the contact form sent to my email

my website is
I have attached the contact.php code below for you to examine. I personally scoured the code and could not figure out anything however I am no PHP coder or know much about it unfortunately.

All help is much regarded so thank you in advance for your time and help

Code: Select all


if(!$_POST) exit;

$email = $_POST['email'];

//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
   $error.="Invalid email address entered";
if($errors==1) echo $error;
   $values = array ('name','email','message');
   $required = array('name','email','message');
   $your_email = "";
   $email_subject = "New Message: ".$_POST['subject'];
   $email_content = "new message:\n";
   foreach($values as $key => $value){
      if ($key != 'subject' && $key != 'name') {
        if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
      $email_content .= $value.': '.$_POST[$value]."\n";
   if(@mail($your_email,$email_subject,$email_content)) {
      echo 'Message sent!';
   } else {
      echo 'ERROR!';

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 5 guests