WaveLine Posted July 1, 2007 Share Posted July 1, 2007 I'm trying to put together a simple mail script to later integrate with a forum on my website. I'm new to php but I don't see where I went wrong compared to other scripts it's not echoing anything or mailing for that case so does anyone see the problem with the script? please help me correct this it would be very much appreciated. <?php $name = "Jared Vasquez"; $phone = "(952)415-0294"; $ebudget = "$0.00"; $company = "Wave Line"; $business = "Production"; $from = "love@gmail.com"; $website = "http://waveline.net"; $summary = "A working, well organized php script for emailing variables sent from contact form"; $to = "WaveLine@gmail.com"; $from_header = "From: $from"; //build contents $contents = "$name\n\r $phone\n\r $from\n\r $ebudget\n\r $company\n\r $business\n\r $website\n\r $summary"; $subject = "$company $name" if($contents != "") { mail($to, $subject, $contents, $from_header); header("Location: http://waveline.net"); echo "<HTML><BODY>Sent!"; echo "</BODY></HTML>"; } else { echo "<HTML><BODY>Error"; echo "</BODY></HTML>"; } ?> Quote Link to comment Share on other sites More sharing options...
azisnomarsa Posted July 1, 2007 Share Posted July 1, 2007 Check your php.ini file, is smtp sever configured. Check this link: http://builder.com.com/5100-6371-5272345.html Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted July 1, 2007 Share Posted July 1, 2007 <?php $name = "Jared Vasquez"; $phone = "(952)415-0294"; $ebudget = "$0.00"; $company = "Wave Line"; $business = "Production"; $from = "love@gmail.com"; $website = "http://waveline.net"; $summary = "A working, well organized php script for emailing variables sent from contact form"; $to = "WaveLine@gmail.com"; $from_header = "From: $from"; //build contents $contents = "$name\n\r $phone\n\r $from\n\r $ebudget\n\r $company\n\r $business\n\r $website\n\r $summary"; $subject = "$company $name" if($contents != "") { mail($to, $subject, $contents, $from_header); header("Location: http://waveline.net"); echo "<HTML><BODY>Sent!"; echo "</BODY></HTML>"; } else { echo "<HTML><BODY>Error"; echo "</BODY></HTML>"; } ?> Try this code: if(!($contents== "")) { mail($to, $subject, $contents, $from_header); header("Location: http://waveline.net"); echo "<HTML><BODY>Sent!"; echo "</BODY></HTML>"; } else { echo "<HTML><BODY>Error"; echo "</BODY></HTML>"; } or why not try with some arbitrary names: mail("to@gmail.com","subject","body","From:from@gmail.com"); check whether SMTP server is ok! 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.