raman Posted June 6, 2009 Share Posted June 6, 2009 Here is my very simple script for a feedback form, though everything seems fine in the script, it shows the message,--your message has been sent .... after taking lot of time, around 3-4 minutes, however the email never reaches. ( I have two mail functions, one to send the mail to the user and another to my email.) Do I need to make any special changes in php.ini for the emails to reach ? <?php $emai = $_REQUEST['email'] ; $messa = $_REQUEST['message'] ; if (strlen($messa)<=401){ mail( "[email protected]", "Feedback Form Results", $message, "From: $emai" ); mail( "$emai", "Feedback form copy", $message, "From: The Team" ); //header( "Location: http://192.168.1.16/iccg/thankyou.html" ); echo "<font color='#d11010' size='4'>Your message has been sent to The team.<br>A copy has been delivered to $emai for you reference.</font>"; }else{ echo "<font color='#d11010' size='4'>Please enable javascript on your browser,then send the message !!</font>"; } ?> Link to comment https://forums.phpfreaks.com/topic/161154-mail-function-not-working/ Share on other sites More sharing options...
trq Posted June 6, 2009 Share Posted June 6, 2009 Have you got a mail server configured? Link to comment https://forums.phpfreaks.com/topic/161154-mail-function-not-working/#findComment-850414 Share on other sites More sharing options...
raman Posted June 6, 2009 Author Share Posted June 6, 2009 No I did not configure anything. Please tell me how to do that. Link to comment https://forums.phpfreaks.com/topic/161154-mail-function-not-working/#findComment-850417 Share on other sites More sharing options...
Yesideez Posted June 6, 2009 Share Posted June 6, 2009 Instead of using mail() on its own you can use something like this: if (mail($emai, "Feedback form copy",$message,"From: The Team <[email protected]>\r\n")) { echo 'Mail sent'; } else { echo 'Mail not sent'; } The only other change I made was to add the from email address and added a new line and live feed on the end. The other option is to use PHPMailer - a third party script you can download and use for free (Google will be your friend) Link to comment https://forums.phpfreaks.com/topic/161154-mail-function-not-working/#findComment-850434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.