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("admin@mydomain.com", $subject, $message, $from); } ?> Thanks in advance. Raz Quote Link to comment 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); Quote Link to comment 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("admin@video.english-hooligans.co.uk", $subject, $message, $from); } ?> Thanks again, Raz Quote Link to comment 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.