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 = '[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 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] :) Link to comment https://forums.phpfreaks.com/topic/32947-entring-_post-data-into-mail-function/#findComment-153404 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.