thesecraftonlymultiply Posted April 29, 2008 Share Posted April 29, 2008 Hi everyone, Hopefully this will be a nice easy one for you... Here is the code I am currently using: <?php $name = $_REQUEST['name']; $email = $_REQUEST['email']; $enquiry = $_REQUEST['enquiry']; mail( "[email protected]", "Booking Enquiry: ", $name, $enquiry, "From: $email" ); ?> This works but when the mail comes through it says it is from: [email protected] Also I would like in the subject box for Booking Enquiry: $name (the persons name) to appear. Can anyone please help? Thanks alot, luke Link to comment https://forums.phpfreaks.com/topic/103392-need-help-with-simple-php-sendmail-script/ Share on other sites More sharing options...
JSHINER Posted April 29, 2008 Share Posted April 29, 2008 <?php $name = $_REQUEST['name']; $email_to = $_REQUEST['email']; $email_you = "[email protected]"; $enquiry = $_REQUEST['enquiry']; $subject = "Booking Enquiry: " . $name; $header .= "From: ".$email_you."\r\n"; $mailresult = mail($email_to,$subject,$enquiry, $header); if($mailresult) { echo 'Email Sent!'; } else { echo 'Error!'; } ?> Link to comment https://forums.phpfreaks.com/topic/103392-need-help-with-simple-php-sendmail-script/#findComment-529480 Share on other sites More sharing options...
thesecraftonlymultiply Posted April 30, 2008 Author Share Posted April 30, 2008 Hi there, Thanks alot for your reply. This didn't actually work It comes up with "Email Sent" but alas the email never arrives. Any suggestions? Luke x Link to comment https://forums.phpfreaks.com/topic/103392-need-help-with-simple-php-sendmail-script/#findComment-530157 Share on other sites More sharing options...
thesecraftonlymultiply Posted April 30, 2008 Author Share Posted April 30, 2008 Ok got it working now, had to switch "to" and "you" around in the code. Thanks alot! Link to comment https://forums.phpfreaks.com/topic/103392-need-help-with-simple-php-sendmail-script/#findComment-530173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.