CoreyR Posted March 13, 2007 Share Posted March 13, 2007 I've been at this for a few hours and can't get it to work right. I'm trying to email everyone in my database. <? mysql_connect("mysql", "xxxx", "xxxx") or die(mysql_error()); mysql_select_db("data") or die(mysql_error()); include 'admin_header.php'; $data = mysql_query("SELECT * FROM clients") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { $to = $info['email']; $subject = $_POST['subject']; $body = $_POST['content']; mail($to, $subject, $body) } Print "Done<br>"; include 'admin_footer.php'; ?> Thanks for the help! Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted March 13, 2007 Share Posted March 13, 2007 what error message you get? Quote Link to comment Share on other sites More sharing options...
CoreyR Posted March 13, 2007 Author Share Posted March 13, 2007 I'm getting a blank page. Quote Link to comment Share on other sites More sharing options...
interpim Posted March 13, 2007 Share Posted March 13, 2007 after mail($to,$subject,$body) add a semicolon ; and where does the $info[] array get filled? Quote Link to comment Share on other sites More sharing options...
CoreyR Posted March 13, 2007 Author Share Posted March 13, 2007 OMG, I thought I tried that. Thanks for the help! 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.