Jump to content

Entring $_POST data into mail function


chrispols

Recommended Posts

Hey everyone,
How would I put $_POST data into an automatic email being sent..

Code for the email page is:

<?php
         
$to      = 'chris@blabhblah.com';
$subject = 'A booking has been entered for San Lameer';
$message = "Hello Ben, \n\n  "$_POST['Email']" This is an automated message informing you that someone has entered booking information for San Lameer. \n\nYou cannot view details as we're not keeping a dbase of the information \n\nRegards \n\nThe San Lameer Website \n\n";
$headers = 'From: admin@blah.com' . "\r\n" .
  'Reply-To: admin@blah.com' . "\r\n" .
  'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

So what are the doodads I need to change on the $_POST to be able to have that part of the email being sent?
Over all I need to have a :

Name : $_POST['FirstName']
Surname : $_POST['Surname']
etc..
kind of idea.. displayed in the email..

Thanks all,

Chris
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.