<?php

	//Recoge variables del Formulario

		/*$piezas=$_REQUEST['deportes'];*/
				
		$nombre_sol=$_REQUEST['name'];
		$email_sol=$_REQUEST['email'];
		
		
			
		if ($nombre_sol=="" and $email_sol=="")
					   
		 {
		   echo "<script>alert('Los campos no pueden estar vacios');  window.parent.location='https://www.seguridadrinpak.com/' </script>";
					        
		  }
		  
		else
		
		
		{
		
		
		//Envia Mail
		
		$asunto2="Tienes un nuevo contacto";
		$retorno="\r\n";
		$headers .= "X-Sender: ".$micorreo."\n";
		$headers .= "X-Priority: 1\n"; 
		$headers .='x-mailer: php/' . phpversion() . "\r\n"; 
		$headers .= "X-Mailer: PHP - https://mydbi.mxhttps://www.seguridadrinpak.com\n";
		$headers = "MIME-Version: 1.0\r\n" ;
		$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
		$headers.= "From:$email_sol\r\n.";
		$headers.= "Reply-To:$email_sol\r\n";
		$headers.= "BCC:rinpakdireccion@gmail.com \r\n";
		$headers.= "BCC:marymendoh29@gmail.com\r\n";
		

		$mfinal.= "<html>
		<head>
		<title></title>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
		</head>
		<body>   
		<style>
.ley{
	color:#13436b;
	font-weight: bold;
}
</style>
		<strong style='font-size:16pt;color:#13436b;text-align:center'> </strong>
		<br>
		<p class='Estilo1'>Nombre: $nombre_sol</p>
		<p class='Estilo1'>Email: $email_sol</p>
		
		<p class='ley'></p>
		</body>
		</html>";

		$sinacento = array("Ã¡", "é", "Ã­","ó","ú"); 
		$cambio = array("á", "é", "í","ó","ú");
		$frase = $mfinal;
		$frase=utf8_decode($mfinal);
		$mfinal = str_replace($sinacento, $cambio, $frase); 
		$resultado=mail($email1, $asunto2, $mfinal, $headers);
	//--------------------------------------------------------------------------------------
  
	 echo "<script>alert('Gracias, su email ha sido enviado');  window.parent.location='https://www.seguridadrinpak.com/' </script>";
	   
	}
	 
?>