0

well there is the code and its not emailing me anything when i fill in the form. kind of new to php :((actully first time doing it.)

<?php
/*code for form */

		
		$emailSubject = ' PHP Scripting';
		$webMaster = '******@gmail.com';/*just made stars for this site*/
		
	
		
		$email = $_POST['email'];
		$name = $_POST['name'];
		$phone = $_POST['phone'];
		$budget = $_POST['budget'];
		$travelers = $_POST['travelers'];
		$comments = $_POST['comments'];
		$newsletter = $_POST['newsletter'];
		
	
		
		$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone Number: $phone <br>
Budget: $budget <br>
Number of Travelers:$travelers<br>	
Newsletter:$newsletter <br>
EOD;

		$headers = "From: $email\r\n";
		$headers .= "Content-type: text/html\r\n";
		$success = mail($webMaster, $emailSubject, $body, $headers);
		



	$theResults = <<<EOD
<html>
<head>
<title>JakesWorks - travel made easy-Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-color: #f1f1f1;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	line-height: normal;
	font-weight: normal;
	color: #666666;
	text-decoration: none;
}
-->
</style>
</head>

<div>
  <div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
	

?>
6
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

Try making a simple version.

mail("******@gmail.com", "Test Mail", "We have success");

If this does not work neither, your hosting provider probably doesn't support mail.
Usually locally hosted servers does nor.

Also, have you checked your spamfilters? :)

If you need a good webhost, take a look at Blanye Webhosting.

0

I know just enough about PHP to wreck my own code... but, as Zoon said, try to keep the form mailing part simple. I would get rid of the $success in front of mail. I do not see that you are referring or using the $success variable anywhere. You can also find a reasonable PHP form mailer on Elizabeth Castro's site
http://www.cookwood.com/html/
I recommend using it or at least examining it closely to see how to incorporate form validation techniques. Otherwise, there are those that like to spam and try to send all sorts of garbage. Hope that helps.

0

well i dont get no error it doesnt send the email when i fill in the form......

and thanks guys i changed the stuff u said but same problem.... but i m gona keep messing around thanks for all ur help

0

Stupid question: are you running your script on your localhost? if yes, do you have a mail server installed?

0
$success = @mail($webMaster, $emailSubject, $body, $headers);
if ($success) echo "Mail Sent";
else echo "Error in sending mail";

You should test with your webserver and not with your local machine without internet.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.