Page 1 of 1

Simple (for you!) email query

Posted: Thu Mar 09, 2006 8:18 am
by Richking
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi there, bit of a php newbie....

I'm trying to sort out just a simple  form to be emailed.....

an excerpt from the form is here:

Code: Select all

<form action="booking.php" method="post">
  <table width="700" border="0">
    <tr>
      <td width="93">Name </td>
      <td width="237"><input type="text" name="username" size="35"/></td>
      <td width="23">&nbsp;</td>
      <td>Email </td>
      <td><input type="text" name="usermail" size="35"/></td>
      <td>&nbsp;</td>
      <td>Address</td>
      <td><input type="text" name="useraddr" size="35"/></td>
      <td>&nbsp;</td>
In booking.php the code i have is here....

Code: Select all

<?
$to="X@XXXX.XXX";
$subject=" Booking Form";
$message=$username,$usermail,$useraddr;
mail($to,$subject,$message);
?>
Question is, mail is being sent all works fine but the $message part isn't working.....Any ideas why?

Thanks in advance


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Mar 09, 2006 8:26 am
by feyd

Code: Select all

$message=$_POST['username'] . "\n" . $_POST['usermail'] . "\n" . $_POST['useraddr'];

Thanks

Posted: Thu Mar 09, 2006 8:35 am
by Richking
Thats great thanks and comments noted!