Renshaw Posted December 9, 2010 Share Posted December 9, 2010 Hello, How do create a box for people to write in that sends the message to my email inbox? Without it opening up outlook on click. like the customer service ones you get on companies websites. Link to comment Share on other sites More sharing options...
0 the better twin Posted December 9, 2010 Share Posted December 9, 2010 http://www.w3schools.com/php/php_mail.asp <html> <body> <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "someone@example.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; } ?> </body> </html> Link to comment Share on other sites More sharing options...
0 +Dick Montage Subscriber² Posted December 9, 2010 Subscriber² Share Posted December 9, 2010 It's a mixture of an HTML form, PHP script and the sendmail functionality. Are you familiar with any of the above? Link to comment Share on other sites More sharing options...
0 Renshaw Posted December 9, 2010 Author Share Posted December 9, 2010 Not at all :( I had a play around with it to see if i could work it out. I need more guidance. thank you. Link to comment Share on other sites More sharing options...
0 +Dick Montage Subscriber² Posted December 9, 2010 Subscriber² Share Posted December 9, 2010 Hmmm, ok... 1) Build a HTML form with a text box and a submit button that sends to itself 2) Inject some PHP into this page so that if it has a $_REQUEST variable set that corresponds with your form variables, it writes said data to the screen 3) Ammend the above so that if it has the specified variable, it doesn't render the form, but rather a thank you comment 4) Ammend the above so that it also sends an email 5) Ammend the above so that the content of that email is the value of the variable Link to comment Share on other sites More sharing options...
Question
Renshaw
Hello,
How do create a box for people to write in that sends the message to my email inbox?
Without it opening up outlook on click.
like the customer service ones you get on companies websites.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts