elhefe12 Posted June 6, 2012 Report Posted June 6, 2012 (edited) <?phpfunction get_rand_id($length=2, $uselower=1, $useupper=0, $usespecial=0, $usenumbers=1, $prefix='') { $key = $prefix; srand((double)microtime() * rand(1000000, 9999999)); $charset = ""; if ($uselower == 1) $charset .= "abcdefghijkmnopqrstuvwxyz"; if ($useupper == 1) $charset .= "ABCDEFGHIJKLMNPQRSTUVWXYZ"; if ($usenumbers == 1) $charset .= "0123456789"; if ($usespecial == 1) $charset .= "~#$%^*()_+-={}|]["; while ($length > 0) { $key .= $charset[rand(0, strlen($charset)-1)]; $length--; } return $key;} function RFCDate() { $tz = date("Z"); $tzs = ($tz < 0) ? "-" : "+"; $tz = abs($tz); $tz = ($tz/3600)*100 + ($tz%3600)/60; $result = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz); return $result;}$message = file_get_contents('message.html');$arr = file('mail_list.txt');$linkpics = 'http://www.site/hap/images';$href = 'http://www.site/hap/';///////////////////////////////////////////////////////////////////////////////////////print 'STARTED SENDING<br>================================================<br>';$k=0;foreach($arr as $var){ $theuser = trim($var); $link = $href.'avs.php?'.get_rand_id(5).'='.get_rand_id(4).'&'.get_rand_id(5).'='.get_rand_id(4).'&'.get_rand_id(5).'='.get_rand_id(4).'&'.get_rand_id(5).'='.get_rand_id(4).'&'.get_rand_id(5).'='.get_rand_id(4).'&'.get_rand_id(6).'='.get_rand_id(4); $subject = "Hello World"; $fromname = 'Spanac'; $gen = 'id'.get_rand_id(5,0,0,0,1).'-site.com'; $fromaddress = 'message@'.$gen; $header = "From: \"".$fromname."\" <".$fromaddress.">\r\n"; $header .= "Reply-To: ".$fromaddress." \r\n"; $header .= "Content-Type: text/html\r\n"; $header .= "Date: " . RFCDate() . "\r\n"; $header .= "Return-Path: ". $fromaddress ."\r\n"; $header .= "Message-ID: ".md5(uniqid(time()))."@".$gen."\r\n"; $header .= "X-Priority: 5\r\n\n"; $msg = str_replace('_images_', $linkpics, $message); $msg = str_replace('_link_', $link, $msg); $k++; $mailit = mail($theuser, $subject, $msg, $header); print $k.'. Sending to: '.$theuser.' ... '; if($mailit){ print 'Sent! <br>'; $fp = fopen('log',"a+"); fwrite($fp,"$theuser\tSent!\r\n"); fclose($fp); } else { print 'Not Sent! <br>'; $fp = fopen('log',"a+"); fwrite($fp,"$theuser\tNot Sent!\r\n"); fclose($fp); } }?>Creati message.html si la directorul de poze puneti : _images_ si daca aveti link ceva puneti : _link_ Edited June 7, 2012 by aelius pentru o formatare corecta foloseste tag-urile [PHP] si [/PHP] Quote
GarryOne Posted June 7, 2012 Report Posted June 7, 2012 Recomand Worx International Inc. , foloseste SMTP propriu Quote
CristalOffice Posted June 11, 2012 Report Posted June 11, 2012 stai dar ce legatura are cu showoff? Quote