Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/08/2011, 20:08
Avatar de cristian_db
cristian_db
 
Fecha de Ingreso: julio-2009
Mensajes: 105
Antigüedad: 14 años, 9 meses
Puntos: 4
Respuesta: duda envio mail php

para enviar mail puedes utilizar

Código PHP:
Ver original
  1. <?php
  2.  
  3. $nombre_origen    = "Web";
  4. $email_origen     = "[email protected]";
  5. $email_copia      = "[email protected]";
  6. $email_ocultos    = "[email protected]";
  7. $email_destino    = "[email protected]";
  8.  
  9.  
  10.  
  11. $asunto           = "Asunto";
  12.  
  13. $mensaje          = 'Hola usuario + mensaje ';
  14.  
  15.  
  16.  
  17. $formato          = "html";
  18.  
  19. //*****************************************************************//
  20. $headers  = "From: $nombre_origen <$email_origen> \r\n";
  21. $headers .= "Return-Path: <$email_origen> \r\n";
  22. $headers .= "Reply-To: $email_origen \r\n";
  23. $headers .= "Cc: $email_copia \r\n";
  24. $headers .= "Bcc: $email_ocultos \r\n";
  25. $headers .= "X-Sender: $email_origen \r\n";
  26. $headers .= "X-Mailer: [Habla software de noticias v.1.0] \r\n";
  27. $headers .= "X-Priority: 3 \r\n";
  28. $headers .= "MIME-Version: 1.0 \r\n";
  29. $headers .= "Content-Transfer-Encoding: 7bit \r\n";
  30. $headers .= "Disposition-Notification-To: \"$nombre_origen\" <$email_origen> \r\n";
  31. //*****************************************************************//
  32.  
  33. if($formato == "html")
  34.  { $headers .= "Content-Type: text/html; charset=iso-8859-1 \r\n";  }
  35.    else
  36.     { $headers .= "Content-Type: text/plain; charset=iso-8859-1 \r\n";  }
  37.  
  38. if (@mail($email_destino, $asunto, $mensaje, $headers))
  39.     {echo "Mail Enviado";   }
  40.      else
  41.     { echo "Mail No Enviado"; }
  42.  
  43.        
  44.  
  45. ?>