Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/11/2014, 08:14
mauritosuarez
 
Fecha de Ingreso: octubre-2014
Ubicación: Buenos Aires
Mensajes: 278
Antigüedad: 9 años, 6 meses
Puntos: 12
Respuesta: Poblema con formulario de contacto

Hola ivancheaib1, prueba con esto. Cambie el action de tu form y agregue 3 input de tipo hidden donde puedes modificar el mail.

HTML
Código HTML:
Ver original
  1. <div class="main">
  2.          <div class="wrap">
  3.              <div class="contact">
  4.               <div class="m_contact"><span class="left_line1"> </span>Contact<span class="right_line1"> </span></div>
  5.               <p class="m_12">Busca más información sobre nosotros, ayudese a mejorar, mejore su calidad de vida, ya sea laboral - matrimonial y hasta espiritualmente, encuentre la felicidad con nosotros!.</p>
  6.               <div class="contatct-top">
  7.                <form method="post" action="send-mail.php">
  8.                     <div class="to">
  9.                          <input type="text" class="text" value="Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Name';}">
  10.                          <input type="text" class="text" value="Email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}" style="margin-left: 10px">
  11.                     </div>
  12.                     <div class="to">
  13.                          <input type="text" class="text" value="Your Website" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Your Website';}">
  14.                          <input type="text" class="text" value="Subject" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Subject';}" style="margin-left: 10px">
  15.                     </div>
  16.                     <div class="text">
  17.                        <textarea value="Message:" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Message';}">Message:</textarea>
  18.                     </div>
  19.                     <div>
  20.                            <input type="submit" value="Submit">
  21.                     </div>
  22.  
  23. <!-- Acá editas el mail -->
  24. <input type="hidden" value="[email protected]" name="to" id="to" />
  25.                         <input type="hidden" value="[email protected]" name="from" id="from" />
  26.                         <input type="hidden" value="Consulta de usuario" name="subject" id="subject" />
  27.  
  28.                </form>
  29.              </div>


send-mail.php
Código PHP:
Ver original
  1. <?php
  2. $subject = $_POST['subject'];
  3. $to = explode(',', $_POST['to'] );
  4.  
  5.  
  6. //data
  7. $msg = "Nombre: "  .$_POST['name']    ."<br>\n";
  8. $msg .= "Email: "  .$_POST['email']    ."<br>\n";
  9. $msg .= "Mensaje: "  .$_POST['comments']    ."<br><br>\n";
  10.  
  11.  
  12. //Headers
  13. $headers  = "MIME-Version: 1.0\r\n";
  14. $headers .= "Content-type: text/html; charset=UTF-8\r\n";
  15. $headers .= "From: <".$from. ">" ;
  16.  
  17.  
  18. //send for each mail
  19. foreach($to as $mail){
  20.    mail($mail, $subject, $msg, $headers);
  21.    echo $mail;
  22. }
  23. ?>

Espero te sirva.

Saludos.
__________________
http://www.sp-vision.net