web_noob Posted June 14, 2007 Share Posted June 14, 2007 ok i have a php script i want it to send the form data to a email address i try the html form post method but every time it opens outlook express and in the text field where you type the message its has the form data i make it post the form data by mailto:myemail@gmail.com or what ever i think i need a mail script that the php form sends it to the script i cant remember does anyone have a mail script thing that i can use and can you make it send all the form data to the email address ilovecakelots@gmail.com Thanks Quote Link to comment https://forums.phpfreaks.com/topic/55625-help-with-mail-script/ Share on other sites More sharing options...
Full-Demon Posted June 14, 2007 Share Posted June 14, 2007 Google it, or try to make it yourself. Make a form and use POST as method. Than use mail() if you want to keep it simple (or SwiftMailer.org if you want a better sollution or phpmailer). Than fill in the information of the form in the message to send. Not very difficult, but can be hard for a beginner. FD Quote Link to comment https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274862 Share on other sites More sharing options...
liam1412 Posted June 14, 2007 Share Posted June 14, 2007 Ok all you need to do is collect the data using POST and then put it into a mail script This is just an example from one I used. This relies on you having a mail server set up on your host. If you buy web hosting chances are you will have and it will be all set up ready to go. if you are testing on your local host you can use a program called AGS mail server. http://www.phpeasystep.com/phptu/23.html This is a tutorial on setting up AGS Mail server on your localhost for testing. Anyways the script is $from = 'admin@rotherham-guide.com'; $addy = $email; $subject = 'Welcome to rotherham-guide.com'; $message = 'The Body of the message goes here'; $send = mail($addy, $subject, $message, "From:$from\n" . "MIME-Version:1.0\n" . "Content-type:text/html; charset=iso-8859-1"); Quote Link to comment https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274866 Share on other sites More sharing options...
liam1412 Posted June 14, 2007 Share Posted June 14, 2007 All you need to do to get it to send the details to your e-mail is change $addy = $email to $addy = 'ilovecakelots@gmail.com'; That any good for you. Quote Link to comment https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274871 Share on other sites More sharing options...
BhA Posted June 14, 2007 Share Posted June 14, 2007 hey this might help if you are getting variables from a form <form method="post" action="sendmail.php"> Email: <input name="email" type="text" /><br /> Message:<br /> <textarea name="message" rows="15" cols="40"> </textarea><br /> <input type="submit" /> </form> php code: <? $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "yourname@example.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.example.com/thankyou.html" ); ?> Quote Link to comment https://forums.phpfreaks.com/topic/55625-help-with-mail-script/#findComment-274896 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.