chrispols Posted January 5, 2007 Share Posted January 5, 2007 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 Quote Link to comment Share on other sites More sharing options...
matto Posted January 5, 2007 Share Posted January 5, 2007 [code]<?php$email_body = "First Name: " . $_POST['firstname'] . "\n";$email_body .= "Last Name: " . $_POST['lastname'] . "\n";$email_body .= "Email Address: " . $_POST['email'] . "\n";?>[/code] :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.