Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/07/2016, 21:04
Blasgo
 
Fecha de Ingreso: abril-2010
Ubicación: Lima
Mensajes: 116
Antigüedad: 14 años
Puntos: 1
Enviar copia oculta

Hola amigos, no se nada de PHP, he comprado una plantilla web, quiero que cuando se envíe un formulario llegue con copia oculta a otro correo.
Código:
Código PHP:
Ver original
  1. <?php
  2.     // Your Email Address
  3.     $youremail = "[email protected]";
  4.  
  5.     // Register Form
  6.     if ( isset($_POST['telephone']) && isset($_POST['name']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ) {
  7.  
  8.         // Detect & Prevent Header Injections
  9.         $test = "/(content-type|bcc:|cc:|to:)/i";
  10.         foreach ( $_POST as $key => $val ) {
  11.             if ( preg_match( $test, $val ) ) {
  12.                 exit;
  13.             }
  14.         }
  15.  
  16.         // Email Format
  17.         $body  =    "SOLICITANTE: \n\n";
  18.         $body .=    "Nombre: $_POST[name] \n\n";
  19.         $body .=    "Correo: $_POST[email] \n\n";
  20.         $body .=    "Telefono: $_POST[telephone] \n\n";
  21.     $body .=    "Hotel:  $_POST[ticket] \n\n";
  22.     $body .=    "Fecha de llegada:  $_POST[llegada] \n\n";
  23.     $body .=    "Fecha de salida:  $_POST[salida] \n\n";
  24.     $body .=    "Nro. de adultos:  $_POST[adultos] \n\n";      
  25.                
  26.         //Send email
  27.         mail( $youremail, "Solicitud Tarifa Alojamientos", $body, "From:" . $_POST['email'] );
  28.  
  29.     }
  30. ?>

Gracias por su ayuda.