|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi
I have a web page running. One thing is not working on it. It is not sending the emails from the web, I have the following entry in the *.php file - what is wrong with it? mail("abc7@gmail.com ","Contact",stripslashes($msg), $mailheaders); Please ee below for the full form. Thanks <? // THIS IS THE BEGIINNING OF THE PHP CODE $name = $_POST['name']; $country = $_POST['country']; $phone = $_POST['phone']; $email = $_POST['email']; $comments = $_POST['comments']; $error_msg=""; $msg=""; if(!$name){ $error_msg .= "Your name \n"; } if($name){ $msg .= "Name: \t $name \n"; } if(!$country){ $error_msg .= "Your country \n"; } if($country){ $msg .= "Country: \t $country \n"; } if(!$phone){ $error_msg .= "Your phone \n"; } if($phone){ $msg .= "Phone: \t $phone \n"; } if(!$email){ $error_msg .= "Your email \n"; } if($email){ if(!eregi("^[a-z0-9_]+@[a-z0-9\-]+\.[a-z0-9\-\.]+$", $email)){ echo 'That is not a valid email address. Please<a href="javascript:history.back()"> return </a> to the previous page and try again.'; exit; } $msg .= "Email: \t $email \n"; } if(!trim($comments)){ $error_msg .= "Your comments \n"; } if($comments){ $msg .= "Comments: \t $comments \n"; } $sender_email=""; if(!isset($name)){ if($name == ""){ $sender_name="noisevx.com Customer"; } }else{ $sender_name=$name; } if(!isset($email)){ if($email == ""){ $sender_email="customer@noisevx.com"; } }else{ $sender_email=$email; } if($error_msg != ""){ echo"You didn't fill in these required fields:<br>" . nl2br($error_msg) .'<br>Please <a href="javascript:history.back()"> return </a> to the' ." previous page and try again."; exit;} $mailheaders = "MIME-Version: 1.0\r\n"; $mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n"; $mailheaders .= "From: $sender_name <$sender_email>\r\n"; $mailheaders .= "Reply-To: $sender_email <$sender_email>\r\n"; mail("abc7@gmail.com ","Contact",stripslashes($msg), $mailheaders); header("Location: http://www.xxx.com/index.html"); /* Redirect browser */ //THIS IS THE END OF THE PHP CODE ?> |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"2007" <FW3006@sbcglobal.net> wrote in message news:87030ef9-d7fe-4b55-9874-902dc404623f@s37g2000prg.googlegroups.com... > Hi > > I have a web page running. > One thing is not working on it. > It is not sending the emails from the web, > > I have the following entry in the *.php file - what is wrong with it? > > mail("abc7@gmail.com ","Contact",stripslashes($msg), $mailheaders); > > Please ee below for the full form. > > Thanks Since nobody else has responded (and I'm no expert) - My guess is that you can't have a function in the parameters. Try $msg=stripslashes($msg); mail("abc7@gmail.com ","Contact",$msg, $mailheaders); |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> > mail("a...@gmail.com ","Contact",stripslashes($msg), $mailheaders);
> > Since nobody else has responded (and I'm no expert) - > > My guess is that you can't have a function in the parameters. Try > > $msg=stripslashes($msg); > mail("a...@gmail.com ","Contact",$msg, $mailheaders); Dear Mason, normally you can have a function in the parameters. I suppose nobody answered, because they would have to guess, since the original poster gave no error messages, and did not describe the environment the script is running in. Most likely there is no mail support installed e.g. if it is a windows machine. Cheers Martin ------------------------------------------------ online accounting on bash bases Online Einnahmen-Ausgaben-Rechnung http://www.ea-geier.at ------------------------------------------------ m2m server software gmbh http://www.m2m.at |
|
![]() |
| Outils de la discussion | |
|
|