Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/07/2010, 10:48
Avatar de chulifo
chulifo
 
Fecha de Ingreso: abril-2009
Ubicación: perdido en codigos del PHP, pero aprendo rapido!
Mensajes: 524
Antigüedad: 15 años, 1 mes
Puntos: 18
Respuesta: Enviar e-mail a una lista

Código PHP:
Ver original
  1. <?php
  2. mysql_select_db($database_tengo, $tengo);
  3. $query_mail = "SELECT * FROM prueba_email";
  4. $mail = mysql_query($query_mail, $tengo) or die(mysql_error());
  5.  
  6. while($row = mysql_fetch_array($mail)){
  7.  
  8.  $mail=$row['email'];
  9.  $asunto=$_POST['asunto'];
  10.  $texto=$_POST['mensaje'];
  11.  
  12.  
  13.  $sfrom="[email protected]"; //cuenta que envia
  14. $sdestinatario="$mail"; //cuenta destino
  15. $ssubject="prueba"; //subject
  16. $shtml='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  17. <html xmlns="http://www.w3.org/1999/xhtml">
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  20. <title></title>
  21. </head>
  22.  
  23. <body>
  24. </body>
  25. </html>'; //mensaje
  26. $sheader="From:".$sfrom."\nReply-To:".$sfrom."\n";
  27. $sheader=$sheader."X-Mailer:PHP/".phpversion()."\n";
  28. $sheader=$sheader."Mime-Version: 1.0\n";
  29. $sheader=$sheader."Content-Type: text/html";
  30. mail($sdestinatario,$ssubject,$shtml,$sheader);
  31.  
  32.  
  33. }
  34.  
  35. ?>

Última edición por chulifo; 23/07/2010 a las 16:03