$result = "SELECT * FROM ".DB_PREFIX."users"; while ($data = mysql_fetch_array($result)) { mail($data[email],"subjectas","tekstas pvz blabla"); }