Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created September 23, 2013 21:10
Show Gist options
  • Select an option

  • Save ryaan-anthony/6677036 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/6677036 to your computer and use it in GitHub Desktop.
<?php
include_once("options.php");
$subject = @$_POST['subject'];
$reply = @$_POST['reply'];
$email = @$_POST['email'];
$email_text = @$_POST['email_text'];
$email_text = $email_text;
$arr_email = explode("|",$email);
$arr_subject = explode("|",$subject);
$arr_reply = explode("|",$reply);
$expr = '|\([^\)]+\)|s';
$q = preg_match_all($expr,$email_text,$ARRAY);
$arr_expr_all = array();
if($q!=0){
foreach($ARRAY[0] as $K => $V)
$arr_expr_all[$K] = substr($V,1,strlen($V)-2);
}
for($i=0;$i<count($arr_email);$i++){
$to_email = $arr_email[$i];
$subject = $arr_subject[array_rand($arr_subject)];
$reply = $arr_reply[array_rand($arr_reply)];
//Подготовка текста
$letter = str_replace("<br>","\n",$email_text);
for($j=0;$j<count($arr_expr_all);$j++){
$arr = explode("|",$arr_expr_all[$j]);
$ind = array_rand($arr);
$letter = str_replace($ARRAY[0][$j],$arr[$ind],$letter);
}
while(send_mail($to_email,$subject,$letter,$reply,$reply)!=true){
};
}
echo "ok";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment