<?

$q=mysql_query("SELECT * FROM `mail_to_send` LIMIT 1");

if (mysql_num_rows($q)!=0){

$mail = mysql_fetch_array($q);

$adds="From: \"admin@$_SERVER[HTTP_HOST]\" <admin@$_SERVER[HTTP_HOST]>\n";

$adds .= "Content-Type: text/html; charset=utf-8\n";
mail($mail['mail'],$mail['them'],$mail['msg'],$adds);


mysql_query("DELETE FROM `mail_to_send` WHERE `id` = '$mail[id]'");
}
?>