PHP - generat email from a form??
Hello,
I am designing a form.
Here is the link:
http://www.simplecelebrations.info/contact3.php
For the most part it works. Except for the self generated email function with the little bit of php script I've added.
<?php
$to = "thomas@reelcreative.tv";
$subject = $_POST['subject'];
$body = $_POST['comments'];
$headers = "From:relay-hosting.secureserver.net " . $_POST['emailAddress'] . "\n";
$mailSent = mail($to,$subject,$body,$headers);
?>
This script works. Except I want to add more information from the self generated email.. I want all the information from the form to display in the email I'd receive when a form is submitted.
It seems like there are a maximum of 5 parameters allowed. Is that correct? It doesn't seem right? -But why if I add an additional parameter like 'emailAddress' I get a line of code that shows:
<?php
$to = "thomas@reelcreative.tv";
$subject = $_POST['subject'];
$body = $_POST['comments'];
$headers = "From:relay-hosting.secureserver.net " . $_POST['emailAddress'] . "\n";
$emailAddress= $_POST['emailAddress'];
$mailSent = mail($to,$subject,$body,$emailAddress,$headers);
?>
/home/content/r/e/e/reelcompanies/dead.letter... Saved message in /home/content/r/e/e/reelcompanies/dead.letter
I've no idea where this error comes from? I gist know it the straw that breaks the Camel's back. Because when I remove this one additional parameter this line of code which shouldn't be, goes away.
How can I make my PHP code display all the fields from my form?
I've tried:
<?php
if (array_key_exists('***FormButton***', $_POST)) {
$to = 'mailto:thomas@reelcreative.tv';
$subject = $_POST['subject'];
$body = $_POST['comments'];
$headers = "From:relay-hosting.secureserver.net " . $_POST['emailAddress'] . "\n";
$mailSent = mail($to,$subject,$body,$headers);
}
?>
Which works - except when I add the 6th parameter to be displayed?
Actually correction - It works but I gee the line of code:
/home/content/r/e/e/reelcompanies/dead.letter... Saved message in /home/content/r/e/e/reelcompanies/dead.letter
Or something similar? - What is this how do I make it go away?
Thank you!
