<?php 
if(isset($_POST['submit']))  { 

$ip_addr = (getenv(HTTP_X_FORWARDED_FOR))
    ?  getenv(HTTP_X_FORWARDED_FOR)
    :  getenv(REMOTE_ADDR);

$headers = "From: VitalAsesores.com.mx <site@vitalasesores.com.mx>";
//$to = "admin@vitalasesores.com.mx";
$to = "info@vitalasesores.com.mx";
$subject = "Mensaje desde VitalAsesores.com.mx";
$name_field = $_POST['nameSender'];
$email_field = $_POST['e_mail'];
$message = $_POST['message_txt'];
$body = "Nombre: $name_field \nE-Mail: $email_field\n\n Mensaje:\n $message";
/*smtp($to, $subject, $body, $headers);*/
mail($to, $subject, $body, $headers);
$is_submitted = "Yes";
} else {
$is_submitted = "No";
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Contacto</title>
<!-- <script language="javascript" src="wmmx_js/js.js" type="text/javascript"></script> -->
<link rel="stylesheet" media="all" href="http://www.vitalasesores.com.mx/css/scr.css" type="text/css" />
<style media="all" type="text/css">
	html, body {
		margin:0;
		padding:0;
		border: 0;
		background: white none;
	}
	#contactoForm {
		width: 90%;
		padding-left: 20px;
	}
	#contactoForm label span {
		font-size: smaller;
		color: red;
	}
	#contactoForm input, #contactoForm textarea {
	margin-bottom: 20px;
	}
</style>
</head>
<body id="contactUs">
<div id="wrapper">
  <div id="contentArea">
    <div id="contentAreaWrapper">
	<div id="contactoForm">
	<?php if ($is_submitted == "Yes") { ?>
		<p>Gracias. Su informaci&oacute;n ha sido enviada.</p>
		<p>Nos pondremos en contacto con usted a la brevedad posible.</p>
		<div id="cleaner" style="width=100%;margin-bottom: 150px;clear=both;">&nbsp;</div>
	<?php } else { ?>
		<form action="contacto.php" method="post" name="contact" target="_self" id="contact"  onsubmit="MM_validateForm('nameSender','','R','e_mail','','RisEmail','message_txt','','R');return document.MM_returnValue" >
	          <label for="nameSender">Nombre: <span>(*Requerido)</span></label> <br />
	          <input name="nameSender" type="text" class="type" id="nameSender" value="" size="25"/>
	          <br />
	          <label for="e_mail">E-mail: <span>(*Requerido)</span></label><br />
	          <input name="e_mail" type="text" class="type" id="e_mail" value="" size="25"/>
	          <br />
	          <label for="message_txt">Mensaje: <span>(*Requerido)</span></label><br />
	          <textarea name="message_txt" cols="30" rows="4" class="type" id="message_txt"></textarea>
	          <br />
	          <input type="submit" value="Send" name="submit" id="submit" class="submit" />
		</form>
	<?php } ?>
	</div>
    </div>
  </div>
</div>
</body>
</html>
