grlayouts Posted February 6, 2007 Share Posted February 6, 2007 ok i have a list of email addresses in my database and i want to send a group email to everyone.. when i send it, it comes through blank? the code i have is <? include ("header.php"); $title = "email users"; if ($action == send){ $user=$_SESSION['user']; $select=mysql_query("SELECT * FROM players WHERE user='$user'"); $p=mysql_fetch_object($select); $i8n=mysql_query("SELECT * FROM players WHERE rank != 'Staff'"); $text=strip_tags($_POST['mass_msg']); if(!$text){ }else{ while($object = mysql_fetch_object($i8n)){ $addy=$object[email]; $subject = "HoboTown Newsletter"; $message = "Dear $object[user], <br> $text <br> Thanks! HoboTown Staff E-Mail From $stat[user] Part Of The HoboTown Administration Team.<br> If You See This Message Isnt From HoboTown Please Contact [email protected] "; mail($addy, $subject, $message, "From: <[email protected]>")or die(mysql_error()); print "Message Sucessfully Sent To $object[user] - $object[email]<br>"; } print "Done"; } } ?> <html> <form method="post" action="newsletter.php?action=send"> Message To Send:<br> <textarea name="mass_msg" cols="40" rows="7" id="mass_msg"></textarea> <br><input type="submit" value="E-Mail All Users"> </form> </html> <? } ?> Link to comment https://forums.phpfreaks.com/topic/37327-newsletter/ Share on other sites More sharing options...
ultrus Posted February 7, 2007 Share Posted February 7, 2007 hmmm. Could this part of your code be causing this?: if ($action == send){ //should be? if ($action == "send"){ take care Link to comment https://forums.phpfreaks.com/topic/37327-newsletter/#findComment-178840 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.