shaunbaird Posted May 24, 2008 Share Posted May 24, 2008 Really struggling with this darned script, it SHOULD work fine - al connects fine, and acts like it has sent an email, but.. nothing.. just nothing happens after i hit the submit button, help! <? include('../header.php'); include('../config.php'); if(isset($submit)) { if(empty($who)) { echo "<center><br><br><br> You did not choose the emails recipient.<br> Go <a class=TN href=mail.php> back </a> and make your choice. </center>"; exit; } if(empty($message)) { echo "<center><br><br><br> SILLY BILLY! You are trying to send a blank email. <br> Go <a class=TN href=mail.php> back </a> and write some text. </center>"; exit; } if($_POST['who'] == 'tb_users') { $q1 = "select email from tb_users"; $r1 = mysql_query($q1) or die(mysql_error()); } elseif($_POST['who'] == 'advertisers') { $q1 = "select email from newl "; $r1 = mysql_query($q1) or die(mysql_error()); } while($a1 = mysql_fetch_array($r1)) { $get_general = mysql_query("SELECT * FROM main"); $grow = mysql_fetch_array($get_general); $g_title = $grow[title]; $g_baseurl = $grow[baseurl]; $g_aemail = $grow[adminemail]; $g_newsemail = $grow[newsemail]; $mailheaders = "From: " .$g_newsemail. "\r\n"; $mailheaders .= "Reply-To: " .$g_newsemail. "\r\n"; $mailheaders .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\n"; mail($a1[0], $subject, $message, $mailheaders); } echo "<center><br><br><br>The mail was sent successfully. </center>"; unset($who); exit; } ?> <div align="center"><br> <strong><font size="2" face="Arial, Helvetica, sans-serif">Email Members</font></strong><br> </div> <FORM ACTION=<?=$_SERVER['PHP_SELF']?> METHOD=POST> <table align=center width=550> <tr> <td><font size="2" face="Arial, Helvetica, sans-serif"> Send emails to all: </font></td> <td> <select name=who> <option value="">Select </option> <option value="tb_users">Members </option> </select> </td> </tr> <tr> <td><font size="2" face="Arial, Helvetica, sans-serif">Subject: </font></td> <td><input type=text name=subject></td> </tr> <tr> <td valign=top><font size="2" face="Arial, Helvetica, sans-serif">Message: </font></td> <td><textarea rows=6 cols=45 name=message></textarea></td> </tr> <tr> <td colspan=2 align=center> <input type=submit name=submit value=Send> </td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/107065-why-oh-why-not-working/ Share on other sites More sharing options...
jayrich Posted May 24, 2008 Share Posted May 24, 2008 Looking at your script I can't really see anything wrong but I have one really obvious suggestion which you've probably already checked. Well worth seeing anyway! Have you checked that your sendmail paths etc. are right? Link to comment https://forums.phpfreaks.com/topic/107065-why-oh-why-not-working/#findComment-548882 Share on other sites More sharing options...
shaunbaird Posted May 24, 2008 Author Share Posted May 24, 2008 Not sure how to do that A an easier alternative anyway I now just extract the emails and use my separate bulk email software group mail. Perhaps one day I might get something coded into my sites admin panel thx anyway shaun Link to comment https://forums.phpfreaks.com/topic/107065-why-oh-why-not-working/#findComment-548886 Share on other sites More sharing options...
jayrich Posted May 24, 2008 Share Posted May 24, 2008 http://email.about.com/cs/phpemailtips/qt/et031202.htm explains the mail paths. You'll want to make sure that you are sending the mail using a valid smtp/sendmail facility etc. Check the articles on local/remote hosting (dependent on which one you use). I hope this helps! Link to comment https://forums.phpfreaks.com/topic/107065-why-oh-why-not-working/#findComment-548893 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.