POMO-man Posted September 25, 2007 Share Posted September 25, 2007 Hi, all. I'm trying to set up PHP to have the contents of a form sent to my email box.It's partly working, because I do actually GET an email when I test this form, but the data in the fields won't come through with the email. I'm basically just getting a blank email. Here's the PHP: <? $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $name = $_REQUEST['name'] ; $phone = $_REQUEST['phone'] ; $phoneAreaCode = $_REQUEST['phoneAreaCode'] ; $phonePrefix = $_REQUEST['phonePrefix'] ; $phoneSuffix = $_REQUEST['phoneSuffix'] ; $phoneExtension = $_REQUEST['phoneExtension'] ; $fax = $_REQUEST['fax'] ; $faxAreaCode = $_REQUEST['faxAreaCode'] ; $faxPrefix = $_REQUEST['faxPrefix'] ; $faxSuffix = $_REQUEST['faxSuffix'] ; $topic = $_REQUEST['topic'] ; $finalMessage = $email + $message + $name + $phone + $phoneAreaCode + $phoneSuffix + $phonePrefix + $phoneExtension + $faxAreaCode + $faxSuffix + $faxPrefix + $topic ; mail( "chad@pservices.net", "Contact Form Results", $finalMessage, "From: $email" ); header( "Location: [url="http://www.printingservices.net/contact.html""]http://www.printingservices.net/contact.html"[/url] );?> Here's the link where the form can be found:www.printingservices.net/contact.htmlIf you guys could help, that would be GREAT. Link to comment Share on other sites More sharing options...
denny911 Posted September 25, 2007 Share Posted September 25, 2007 Hi, all. I'm trying to set up PHP to have the contents of a form sent to my email box.It's partly working, because I do actually GET an email when I test this form, but the data in the fields won't come through with the email. I'm basically just getting a blank email. Here's the PHP:<? $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $name = $_REQUEST['name'] ; $phone = $_REQUEST['phone'] ; $phoneAreaCode = $_REQUEST['phoneAreaCode'] ; $phonePrefix = $_REQUEST['phonePrefix'] ; $phoneSuffix = $_REQUEST['phoneSuffix'] ; $phoneExtension = $_REQUEST['phoneExtension'] ; $fax = $_REQUEST['fax'] ; $faxAreaCode = $_REQUEST['faxAreaCode'] ; $faxPrefix = $_REQUEST['faxPrefix'] ; $faxSuffix = $_REQUEST['faxSuffix'] ; $topic = $_REQUEST['topic'] ; $finalMessage = $email + $message + $name + $phone + $phoneAreaCode + $phoneSuffix + $phonePrefix + $phoneExtension + $faxAreaCode + $faxSuffix + $faxPrefix + $topic ; mail( "chad@pservices.net", "Contact Form Results", $finalMessage, "From: $email" ); header( "Location: [url="http://www.printingservices.net/contact.html""]http://www.printingservices.net/contact.html"[/url] );?> Here's the link where the form can be found:www.printingservices.net/contact.htmlIf you guys could help, that would be GREAT. i think it should go like this:$finalMessage = $email . $message . $name . $phone ... instead of using the plus (+) sign.. Link to comment Share on other sites More sharing options...
POMO-man Posted September 25, 2007 Author Share Posted September 25, 2007 I'll try that! thanks! Link to comment Share on other sites More sharing options...
POMO-man Posted September 25, 2007 Author Share Posted September 25, 2007 Coolness. Well, that worked. the data came through with the email.However, it is all in one long string, without any indication of which field it is from. Now, of course i can sort it out, but it's sorta confusing.Is there a way to get each field of info labeled somehow within the email PHP sends? Or at least get each one on its own separate line? How are others solving this issue?THANKS AGAIN! Link to comment Share on other sites More sharing options...
Escyll Posted September 25, 2007 Share Posted September 25, 2007 $finalMessage = $email . $message . $name . $phoneIf you change this in:$finalMessage = $email . "</br>" . $message . "</br>" . $name . "</br>" . $phone etc.That should work i think Link to comment Share on other sites More sharing options...
justsomeguy Posted September 25, 2007 Share Posted September 25, 2007 You can format the message however you want.$finalMessage = "Email: {$email}\n";$finalMessage .= "Message: {$message}\n";$finalMessage .= "Name: {$name}\n";etc Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.