Se solicita Alguien que arregle este forumlario de contacto

  • Autor Autor shoyle
  • Fecha de inicio Fecha de inicio
Estado

🔒 Este tema está cerrado para nuevas respuestas.

⏰ Solo el creador del tema puede solicitar la reapertura de sus propios temas, pero únicamente dentro de los 60 días previos a la última actualización.

S

shoyle

Beta
Diseñador
No recomendado
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
El sitio esta basado en la palntilla gratuita de html5 BRUSHED y el problema que tiene es que no envia el mensaje de la pagina si el remitente tiene una direccion de e-mail distinta a hotmail.com

les dejo el html y el php

doy 8 dolares al primero que me lo arregle






HTML:
<!-- Contact Section -->
<div id="contact" class="page">
<div class="container">
    <!-- Title Page -->
    <div class="row">
        <div class="span12">
            <div class="title-page">
                <h2 class="title">Contáctenos</h2>
                <h3 class="title-description">Envíenos consultas y propuestas para su casa prefabricada.</h3>
            </div>
        </div>
    </div>
    <!-- End Title Page -->
    
    <!-- Contact Form -->
    <div class="row">
    	<div class="span9">
        
        	<form id="contact-form" class="contact-form" action="#">
            	<p class="contact-name">
            		<input id="contact_name" type="text" placeholder="Nombre" value="" name="name" />
                </p>
                <p class="contact-email">
                	<input id="contact_email" type="text" placeholder="E-mail" value="" name="email" />
                </p>
                <p class="contact-message">
                	<textarea id="contact_message" placeholder="Mensaje" name="message" rows="15" cols="40"></textarea>
                </p>
                <p class="contact-submit">
                	<a id="contact-submit" class="submit" href="#">Enviar Mensaje</a>
                </p>
                
                <div id="response">
                
                </div>
            </form>
         
        </div>
         <!-- Contact details-->
        <div class="span3" align="right">
        	<div class="contact-details">
        		<h5>Contáctenos También a:</h5>
                <ul>
                    <li><img src="_include/img/mail.png"></li>
                    <li>(+598) 094-421-526</li>
                    <li>Ruta 1. Km 155 </li>
                     <li><h5></h5></li>
                    
                     <li><iframe src="https://mapsengine.google.com/map/embed?mid=zesyikKNNw64.kSzOsVsWHjXg" width="100%" height="30%"></iframe></a>
                       </li>
                    </li>
                    
                    <h5> </h5>
                    
                     <div class="social-area">
            	<ul class="social-icons">
                	<li><a href="https://www.facebook.com/prefaburuguay" target='_blank'><img src="_include/img/f.png" width="50" height="50" align="center"></a></li>
                   
                    <li><a href="https://twitter.com/prefaburuguay" target='_blank'>
                    <img src="_include/img/t.png" width="50" height="50" align="center">
                  </a></li>
                </ul>
            </div>
                    
                    
                </ul>
            </div>
        </div>
    <!-- End Contact details-->
    </div>
    <!-- End Contact Form -->
</div>
</div>




<!-- End Contact Section -->


                    
               
<!-- Footer -->
<footer>
	<p class="credits">powered by <a href="http://pumsho.com" title="powered by Pumsho Diseño Web">Pumsho diseño web.</a> 2014 </p>
</footer>
<!-- End Footer -->

<!-- Back To Top -->
<a id="back-to-top" href="#">
	<i class="font-icon-arrow-simple-up"></i>
</a>
<!-- End Back to Top -->


<!-- Js -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <!-- jQuery Core -->
<script src="_include/js/bootstrap.min.js"></script> <!-- Bootstrap -->
<script src="_include/js/supersized.3.2.7.min.js"></script> <!-- Slider -->
<script src="_include/js/waypoints.js"></script> <!-- WayPoints -->
<script src="_include/js/waypoints-sticky.js"></script> <!-- Waypoints for Header -->
<script src="_include/js/jquery.isotope.js"></script> <!-- Isotope Filter -->
<script src="_include/js/jquery.fancybox.pack.js"></script> <!-- Fancybox -->
<script src="_include/js/jquery.fancybox-media.js"></script> <!-- Fancybox for Media -->
<script src="_include/js/jquery.tweet.js"></script> <!-- Tweet -->
<script src="_include/js/plugins.js"></script> <!-- Contains: jPreloader, jQuery Easing, jQuery ScrollTo, jQuery One Page Navi -->
<script src="_include/js/main.js"></script> <!-- Default JS -->
<!-- End Js -->

</body>
</html>








PHP:
<?php
/*
* Contact Form Class
*/


header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');

$admin_email = 'pumsho@hotmail.com'; // Your Email
$message_min_length = 5; // Min Message Length


class Contact_Form{
	function __construct($details, $email_admin, $message_min_length){
		
		$this->name = stripslashes($details['name']);
		$this->email = trim($details['email']);
		$this->subject = 'Mensaje enviado desde Prefaburuguay'; // Subject 
		$this->message = stripslashes($details['message']);
	
		$this->email_admin = $email_admin;
		$this->message_min_length = $message_min_length;
		
		$this->response_status = 1;
		$this->response_html = '';
	}


	private function validateEmail(){
		$regex = '/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i';
	
		if($this->email == '') { 
			return false;
		} else {
			$string = preg_replace($regex, '', $this->email);
		}
	
		return empty($string) ? true : false;
	}


	private function validateFields(){
		// Check name
		if(!$this->name)
		{
			$this->response_html .= '<p>Ingrese un nombre.</p>';
			$this->response_status = 0;
		}

		// Check email
		if(!$this->email)
		{
			$this->response_html .= '<p>Ingrese una direccion de e-mail.</p>';
			$this->response_status = 0;
		}
		
		// Check valid email
		if($this->email && !$this->validateEmail())
		{
			$this->response_html .= '<p>Ingrese una direccion de mail valida.</p>';
			$this->response_status = 0;
		}
		
		// Check message length
		if(!$this->message || strlen($this->message) < $this->message_min_length)
		{
			$this->response_html .= '<p>Ingrese un mensaje. Debe tener al menos '.$this->message_min_length.' caracteres.</p>';
			$this->response_status = 0;
		}
	}


	private function sendEmail(){
		$mail = mail($this->email_admin, $this->subject, $this->message,
			 "From: ".$this->name." <".$this->email.">\r\n"
			."Reply-To: ".$this->email."\r\n"
		."X-Mailer: PHP/" . phpversion());
	
		if($mail)
		{
			$this->response_status = 1;
			$this->response_html = '<p>Gracias! Responderemos a la brevedad.</p>';
		}
	}


	function sendRequest(){
		$this->validateFields();
		if($this->response_status)
		{
			$this->sendEmail();
		}

		$response = array();
		$response['status'] = $this->response_status;	
		$response['html'] = $this->response_html;
		
		echo json_encode($response);
	}
}


$contact_form = new Contact_Form($_POST, $admin_email, $message_min_length);
$contact_form->sendRequest();

?>
 
Última edición:
Hola amigo, se produce algun mensaje cuando el envio no se efectua o simplemente no recibes nada en el correo.
 
te dice gracias el mensaje ha sido enviado pero no llega nunca
 
Estado

🔒 Este tema está cerrado para nuevas respuestas.

⏰ Solo el creador del tema puede solicitar la reapertura de sus propios temas, pero únicamente dentro de los 60 días previos a la última actualización.

Atrás
Arriba