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! Link to comment https://forums.phpfreaks.com/topic/42578-solved-email-help/ Share on other sites More sharing options...
tauchai83 Posted March 13, 2007 Share Posted March 13, 2007 what error message you get? Link to comment https://forums.phpfreaks.com/topic/42578-solved-email-help/#findComment-206650 Share on other sites More sharing options...
CoreyR Posted March 13, 2007 Author Share Posted March 13, 2007 I'm getting a blank page. Link to comment https://forums.phpfreaks.com/topic/42578-solved-email-help/#findComment-206651 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? Link to comment https://forums.phpfreaks.com/topic/42578-solved-email-help/#findComment-206652 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! Link to comment https://forums.phpfreaks.com/topic/42578-solved-email-help/#findComment-206653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.