Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/01/2014, 08:51
Avatar de angel_xx_1990
angel_xx_1990
 
Fecha de Ingreso: junio-2013
Ubicación: Guadalajara
Mensajes: 236
Antigüedad: 10 años, 10 meses
Puntos: 0
Pregunta Respuesta: enviar e-mail mediante php (correo no deseado)

Mirar e conseguido avanzar pero ahora siempre me muestra "Enviado" ANTES DE DARLE AL ENVIAR y no entiendo por que.... haber si alguien se da cuenta de mi error porque no lo entiendo...

Código PHP:
Ver original
  1. <?php
  2. $seEnvio;
  3.  
  4. $name=$_POST['name'];
  5. $asunto= "Asunto: ".$_POST['asunto'];
  6. $mensaje=$_POST['mensaje'];
  7. $de=$_POST['emails'];
  8. $de2=$_POST['emails2'];
  9. $telef=$_POST['telef'];
  10.  
  11. $cabeceras  = 'MIME-Version: 1.0' . "\r\n";
  12. $cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  13. $cabeceras .= 'From: [email][email protected][/email]' . "\r\n";
  14.  
  15. $cuerpomsg ='
  16. <html>
  17. <head>
  18.  <title>Tienes un mensaje nuevo</title>
  19. </head>
  20. <body>
  21. <p>¡Su publicación ha recibido un nuevo mensaje!</p>
  22. <p><b>Contenido:</p>
  23. <p>'.$mensaje.'</p>
  24. <p>Datos de su contacto:</p><br>
  25. Nombre: '.$name.'<br>
  26. E-mail: '.$de.' <br>
  27. Teléfono: '.$telef.'<br>
  28. <p></p>
  29. </body>
  30. </html>
  31. ';
  32.  
  33. if (mail($para,$asunto,$cuerpomsg,$cabeceras)){
  34.    
  35.     $seEnvio = true;
  36. }else{
  37.     $seEnvio = false;
  38. }
  39. if($seEnvio == true)
  40. {
  41.         echo "Enviado";
  42.     }
  43.     else
  44.     {
  45.           echo "No enviado";
  46.     }
  47.  
  48. ?> 
  49.  
  50.  
  51. <body>
  52. <div id="emaildiv"><form method="post" enctype="multipart/form-data" name="formu" id="formu">
  53.     <table width="100%">
  54.     <tr>
  55.     <td><center>Escriba su información de contacto y el texto que desea enviar.</center></td>
  56.   </tr>
  57.   <tr>
  58.     <td>Nombre:<br>
  59.     <input type="text" required maxlength="15" id= "name" name="name"></td>
  60.   </tr>
  61.   <tr>
  62.     <td>E-mail:<br>
  63.     <input type="email" required maxlength="35" id="emails" name="emails"></td>
  64.   </tr>
  65.   <tr>
  66.     <td>Repetir E-mail:<br>
  67.     <input type="email" required maxlength="35" id= "emails2" name="emails2"></td>
  68.   </tr>
  69.   <tr>
  70.     <td>Teléfono:<br>
  71.     <input type="tel" maxlength="15" id= "telef" name="telef"></td>
  72.   </tr>
  73.   <tr>
  74.     <td>Asunto:<br>
  75.     <input type="text" required maxlength="15" id= "asunto" name="asunto"></td>
  76.   </tr>
  77.   <tr>
  78.     <td>Texto:<br>
  79.     <textarea rows="4" required maxlength="250" id= "mensaje" name="mensaje"></textarea></td>
  80.   </tr>
  81.   <tr>
  82.     <td><center><input name="submit" id="submit" type="submit" value="Enviar"></center></td>
  83.   </tr>
  84. </table></form>
  85.  
  86. </div>
  87. </body>
  88. </html>


Mil Gracias!!!!