msa225 Posted December 7, 2006 Share Posted December 7, 2006 Hi,I'm trying to connect a form to an e-mail. This is my PHP file:<? $name = $_REQUEST['name'] ; $eMail = $_REQUEST['eMail'] ; $comments = $_REQUEST['comments'] ; mail("[email protected]", "Comments from Layla Beer website", "Comments: $comments", $eMail ); header( "Location: http://www.laylabeer.com/thanks.html" );?>However, I'm not satisfied with the way the e-mail is displayed. I want it to look like this:name: xxxxxE-mail: xxxxxxcomments: xxxxxxxxIs it possible?Thanks! Link to comment https://forums.phpfreaks.com/topic/29838-connectiong-a-form-to-e-mail/ Share on other sites More sharing options...
matto Posted December 7, 2006 Share Posted December 7, 2006 [code]$to = "[email protected]";$subject = "subject line";$emailbody = "Name: " . $_POST['name'] . "\n";$emailbody .= "Email: " . $_POST['email'] . "\n";$emailbody .= "Comments: " . $_POST['comments'] . "\n";mail($to, $subject, $emailbody);[/code] ;) Link to comment https://forums.phpfreaks.com/topic/29838-connectiong-a-form-to-e-mail/#findComment-137095 Share on other sites More sharing options...
msa225 Posted December 8, 2006 Author Share Posted December 8, 2006 Thank you Matto :D Link to comment https://forums.phpfreaks.com/topic/29838-connectiong-a-form-to-e-mail/#findComment-137255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.