Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php SendMail Help

Status
Not open for further replies.

CrashBetaRev2

Programmer
Joined
Nov 3, 2007
Messages
1
Location
US
in my sendmail i have the following

<?php
$email=$_POST['email']; //who we are sending to
$subject=$_POST['subject']; //the subject of the mail
$message=$_POST['message']; //the body of the mail

mail($email,$subject,$message); //php's mail function, with its 3 parameters

echo "Mail sent" ; //lets us know the mail was sent

?>

what if i have alot more fields that i want to be emailed
how do i include lets say 5 more Fields into the Message
section???
 
Code:
$date = date('Y-m-d H:i:s');
//create the message body
$message = <<<MESSAGE
A message was submitted at $date
the message was
{$_POST['message']}

Other data submitted with the message was
Field 1:   {$_POST['field1']}
Field 2: {$_POST['field2']}
FIeld 3: {$_POST['field3']}

MESSAGE;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top