php email problem

VanHype

New Member
Hi Guys,

i have a html form which sumbits data to a file.. submit_mail.php

recently the email im receiving from the php file has been blank? nothing except telling me a subject and who the email is from

the code in the php file is:



PHP:
<?php 

$type = $_REQUEST["type"]; 
$fname = $_REQUEST["fname"]; 
$lname = $_REQUEST["lname"]; 
$address = $_REQUEST["address"]; 
$phone = $_REQUEST["phone"]; 
$bmail = $_REQUEST["bmail"]; 
$adults = $_REQUEST["adults"]; 
$under18 = $_REQUEST["under18"]; 
$query = $_REQUEST["query"]; 
$date = $_REQUEST["date"]; 
$month = $_REQUEST["month"]; 
$year = $_REQUEST["year"]; 
$duration = $_REQUEST["duration"]; 

  mail( "[email protected]", "General Enquiry", 
    $message, "From: $bmail" ); 
  header( "Location: http://www.domainexample.co.uk/thankyou.html" ); 
?>


any ideas as to why i am receiving blank emails?

im sure i have had emails previously with this code but could be wrong??

thanks for looking
 

EET

New Member
You are not sending the information of the form anywhere in the code. You are just sending the title = "General Enquiry" and $message (which is?). If you want to send those informations above like $type etc. you have to specify them in the code.
 

VanHype

New Member
Thankyou all for your comments

hi guys, thanks very much for your help - im useless with php and it has taught me a few things solving the problem with the help or all of your comments...

the email is successfully working now:

PHP:
<?php

$type = $_REQUEST["type"];
$fname = $_REQUEST["fname"];
$lname = $_REQUEST["lname"];
$address = $_REQUEST["address"];
$phone = $_REQUEST["phone"];
$bmail = $_REQUEST["bmail"];
$adults = $_REQUEST["adults"];
$under18 = $_REQUEST["under18"];
$query = $_REQUEST["query"];
$date = $_REQUEST["date"];
$month = $_REQUEST["month"];
$year = $_REQUEST["year"];
$duration = $_REQUEST["duration"];

  mail( "[email protected]", "General Enquiry",
    $message = "$fname $lname has sent you a $type.\n\n
	- Contact Details -\n
	Name: $fname $lname\n
	Address: $address\n
	Contact Number: $phone\n
	Email Address: $bmail.\n\n
	- Booking Enquiry -\n
	Adults: $adults - Under 18s: $under18 - Dates Required: $date / $month / $year - Duration: $duration nights.\n\n
	- Comments/Questions -\n
	$query", "From: $bmail" );
  header( "Location: http://www.example.co.uk/thankyou.html" );
?>
 
Top