razta Posted April 4, 2007 Share Posted April 4, 2007 Hello, Ive modified my mail script and its decided not to work. The php page goes to the else statement as if it has sent but no email recived. Any suggestions? <?php if(empty($user) || empty($title) || empty($desc) || empty($embedcode)) { echo '<div align="center"><h2><font color="red">ERROR! Fill in all fields! Use back button.</font></h2></div>'; exit; } else { $user = Trim(stripslashes($user)); $title = Trim(stripslashes($title)); $desc = Trim(stripslashes($desc)); $embedcode = Trim(stripslashes($embedcode)); $message = " echo 'date('l, F j, Y, g:i a')' \n Title: $user ($title)\n Description: $desc \n Embed code: $embedcode \n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $user\r\n"; $subject = $desc; mail("[email protected]", $subject, $message, $from); } ?> Thanks in advance. Raz Link to comment https://forums.phpfreaks.com/topic/45575-mail-script-not-working/ Share on other sites More sharing options...
hitman6003 Posted April 4, 2007 Share Posted April 4, 2007 make sure that you are displaying errors... At the top of your page put: ini_set("display_errors", 1); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/45575-mail-script-not-working/#findComment-221399 Share on other sites More sharing options...
razta Posted April 4, 2007 Author Share Posted April 4, 2007 Amended the code as you suggested and no errors came up. Ive also changed the code a little and still no joy. <?php ini_set("display_errors", 1); error_reporting(E_ALL); if(empty($user) || empty($title) || empty($desc)) { echo '<div align="center"><h2><font color="red">ERROR! Fill in all fields! Use back button.</font></h2></div>'; } if(empty($embedcode)) { echo '<div align="center"><h2><font color="red">ERROR! Please give an embed code. Use back button.</font></h2></div>'; } else { $user = Trim(stripslashes($user)); $title = Trim(stripslashes($title)); $desc = Trim(stripslashes($desc)); $embedcode = Trim(stripslashes($embedcode)); $message = " echo 'date('l, F j, Y, g:i a')' \n Title: $user ($title)\n Description: $desc \n Embed code: $embedcode \n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $user\r\n"; $subject = $desc; mail("[email protected]", $subject, $message, $from); } ?> Thanks again, Raz Link to comment https://forums.phpfreaks.com/topic/45575-mail-script-not-working/#findComment-221566 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.