corillo181 Posted April 14, 2006 Share Posted April 14, 2006 hi i'm new to php and i tried everything to do a form and recieve it in to my mail.. i fallow every tutorial on the net i could and still it dont work..is there something my webhost provider most do so it can work? because i know is not me.. i tried all kind of tutorials and still i'm not able to recieve a mail from a form.. Link to comment https://forums.phpfreaks.com/topic/7416-solved-mail-help/ Share on other sites More sharing options...
Orio Posted April 14, 2006 Share Posted April 14, 2006 Can you post your script please?Orio. Link to comment https://forums.phpfreaks.com/topic/7416-solved-mail-help/#findComment-27022 Share on other sites More sharing options...
corillo181 Posted April 14, 2006 Author Share Posted April 14, 2006 i used the scribs from phpfreaks tutorials.. i did the biulding a membership sing up system.. . that one didn't work to send email and i fallowed every step back and forth.. i even did it a few times cuz i wanted to learn how to do it so i can do my own.. everytihng is fine i even get the member info in to my database , but they never get the email..i also tried building a simple form..in that one too the info goes in to the database, but can't send a emailhow about you post a script that works and i can try it and tell you if it did work or if is something wrong with my server provider.... i really need this help this only thing holding me back to learning more about other things..thank you for your help.. Link to comment https://forums.phpfreaks.com/topic/7416-solved-mail-help/#findComment-27041 Share on other sites More sharing options...
Orio Posted April 14, 2006 Share Posted April 14, 2006 <?php$ip = getenv(REMOTE_ADDR);$to = "[email protected]"; $subject = $_POST['subject']; $body = "Name: ".$_POST['Name']." \n Rating: ".$_POST['Rating']." \n \n Comments: \n ".$_POST['Comments']." \n \n $ip"; mail($to,$subject,$body);echo "Thank you "; ?>For example.Orio. Link to comment https://forums.phpfreaks.com/topic/7416-solved-mail-help/#findComment-27050 Share on other sites More sharing options...
corillo181 Posted April 14, 2006 Author Share Posted April 14, 2006 oh that help.. i don't know what was wrong with the tutorials.. but this one work..now the problem witht he form i attach is when the page is view it send a email empty.i know i got to put some thing like if (isset['submit']) so the form is only sent when they press the submit bottum but i dunno how to put that .. Link to comment https://forums.phpfreaks.com/topic/7416-solved-mail-help/#findComment-27066 Share on other sites More sharing options...
jcbarr Posted April 14, 2006 Share Posted April 14, 2006 Have your form pass a variable like this;[code]<input type="hidden" name="send" value="Y">[/code]Then make your script run depending on the value of the send variable;[code]<? $send=$_POST['send'];if ($send=="Y"){place script here } ?>[/code]I don't know if that is the best way to do it, but it has always worked for me. Link to comment https://forums.phpfreaks.com/topic/7416-solved-mail-help/#findComment-27082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.