Generar correos con PHP | Josep Garcia

function generar_mails ($total) {
$emails_generados=$total;
// Rango de ascii q cogemos
$ascii = array(97,122);
$tamanyo_mail = array (10,10,“@”,10,10);
$extension = array (“.com”,“.net”,“.es”,“.us”,“.biz”,“.tv”,“.org”,“.ws”,“.tv”,“.cc”,“.de”,“.be”,“.at”,“.uk”);

mt_srand ((double)microtime() * 1000000);

for (</span>$x=0;$x<$emails_generados;$x++) {
 
// primera parte del mail
 
$parte1 = mt_rand ($tamanyo_mail[0],$tamanyo_mail[1]);
 
$parte2 = mt_rand ($tamanyo_mail[3],$tamanyo_mail[4]);

  </span>$y=0;
 
$cadena=“”;
  while (
$y<=$parte1+$parte21) {
   
$numero_ascii = mt_rand ($ascii[0], $ascii[1]);
   
$cadena .= chr($numero_ascii);
   
$y++;
  }

  </span>$extension_final=$extension[mt_rand (0,count($extension)-1)];
 
$mail_final = substr($cadena,0,$parte1).“@”.substr($cadena,$parte1,$parte2).$extension[mt_rand (0,count($extension)-1)];
  echo
“\n”
;
}
}

generar_mails (10);

Leave a Reply

Your email address will not be published. Required fields are marked *