rendered paste body<form name="form1" method="post" action=""> <p> <textarea name="email" cols="40" rows="10" id="email"></textarea></p> <p>email adreslerini virgulle ayirarak veya alt alta yazin, <br> SPAM yollamayin (bilmediginiz insanlara atmayin)</p> <p> <input type="submit" name="Submit" value="Submit"> </p></form><? $succ=0;$fail=0;$from = "Chicago Turkish Festival <info@chicagoturkishfestival.org>"; $subj = "5th Chicago Turkish Festival - May 30- June 2"; $email = str_replace(array("\r", "\n", "\t"), ',', $email); $email = str_replace(array(",,"), ',', $email); $to = explode(",",$email,100); $body = "<html><body><p><a href=\"http://www.chicagoturkishfestival.org/\" target=\"_blank\"><img src=\"http://www.chicagoturkishfestival.org/images/webBrochure5.jpg\" width=\"680\" height=\"900\" border=\"0\"></a></p><p><img src=\"http://www.chicagoturkishfestival.org/images/webBrochuresp.jpg\" width=\"680\" height=\"248\"></p></body></html>"; $headers = "From: ".$from."\n";$headers .= "MIME-Version: 1.0\r\n";$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";if($email) {mail("tasdelenbaris@gmail.com", "CTF newsletter", $email, $headers);if (count($to) > 0){ include_once("mysql.inc.php"); mysql_connect($_MYSQL['host'], $_MYSQL['user'], $_MYSQL['pass']); mysql_select_db($_MYSQL['db']);}for($i = 0; $i < count($to); $/i++){ $res = mysql_query ("SELECT email FROM mailer WHERE email = '". $to[$i] ."'"); if (mysql_num_rows($res) == 0){if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $to[$i])) { if (mail($to[$i], $subj, $body, $headers)) { $succ++; mysql_query("INSERT INTO mailer(email) VALUES('". $to[$i] ."'"); } else $fail++;}else $fail++;}}}if($email) echo($succ. " sent. ". $fail." failed");?>