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      = '[email protected]';
$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: [email protected]' . "\r\n" .
  'Reply-To: [email protected]' . "\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
https://forums.phpfreaks.com/topic/32947-entring-_post-data-into-mail-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.