Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/06/2008, 14:22
piripaz
 
Fecha de Ingreso: julio-2007
Mensajes: 27
Antigüedad: 16 años, 9 meses
Puntos: 0
enviar formulario por mail

Hola, tengo algunos formularios que estaba enviando a un mail, todo funcionaba perfecto hasta que formatié mi computadora. Hice un par de cambios en la web que no tienen que ver con los formularios, pero los mails dejaron de llegar a destino. No sé si hay algo que tengo que configurar nuevamente o qué. Dejo el código para ver si me pueden ayudar...gracias!

archivo1.php

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Voluntario</title>
<script type="text/javascript">
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
</script>
</head>


<div id="apDiv1">
<table width="458" border="0" align="right">
<tr class="otro">
<td width="132" class="style29"><a href="hagase_socio_2.php" class="otro"><span class="style18 style18"><strong> Socio colaborador</strong></span></a></td>
<td width="139" class="style29"><a href="apadrinar.php" class="otro"><span class="style18 style18"><strong>Apadrinar proyecto</strong></span></a></td>
<td width="100" class="style29"><a href="donacion_unica.php" class="otro"><span class="style18 style18"><strong>Donaci&oacute;n &uacute;nica</strong></span></a></td>
<td width="69" class="style29"><a href="../index.php" class="otro"><span class="style18 style18"><strong>Inicio</strong></span></a></td>
</tr>
</table>
<p align="center" class="style1"><span class="style28">__________________________________ ______________________</span></p>
<p align="center" class="style1">&nbsp;</p>
<p align="center" class="style1"><span class="style28">Para obtener informaci&oacute;n acerca de las formas de voluntariado complete el siguiente formulario y nos comunicaremos con usted</span></p>
<p class="style29"><a href="file:///C|/wamp2/www/cenfa2_10abril/index.php"></a></p>

<blockquote>
<form action="gracias_vol.php" method="post" name="form2" id="form2" onsubmit="MM_validateForm('nombre','','R','tel','' ,'RisNum','mail','','RisEmail');return document.MM_returnValue">
<table width="325" border="0" align="center" bgcolor="#FBD4AB">
<tr>
<td width="88" class="style13">Nombre:</td>
<td width="287"><label>
<input name="nombre" type="text" id="nombre" size="32" />
</label></td>
</tr>
<tr>
<td class="style13">Tel&eacute;fono:</td>
<td><input name="tel" type="text" id="tel" size="32" /></td>
</tr>
<tr>
<td class="style13">Correo electr&oacute;nico:</td>
<td><input name="mail" type="text" id="mail" size="32" /></td>
</tr>
<tr>
<td class="style13">Fecha</td>
<td><input name="fecha" type="text" id="fecha" value="<?php echo gmdate("Y-m-d");?>" size="32" /></td>
</tr>
<tr>
<td class="style13">Comentarios:</td>
<td><label>
<textarea name="mensaje" id="mensaje" cols="32" rows="5"></textarea>
</label></td>
</tr>
<tr>
<td class="style13">&nbsp;</td>
<td><label>
<input type="submit" name="button" id="button" value="Enviar" />
</label></td>
</tr>
</table>
</form>
<p>&nbsp;</p>
</blockquote>
<p>&nbsp;</p>
</div>
<p><a href="../index.php"><img src="../imagenes/logoindex.jpg" width="387" height="210" border="0" /></a></p>
<p>&nbsp;</p>
<table>
<tbody>
<tr>
<td width="100%"><span class="style16"> HAZ TU APORTE...</span></td>
</tr>
</tbody>
</table>
<table width="452" border="0" bordercolor="#F67A30">
<tbody>
<tr>
<td colspan="2" valign="top"><p align="justify" class="Estilo1">Done dinero a CENFA una sola vez, el que permitir&aacute; mantener y aumentar la atenci&oacute;n a aquellas familias de menores recursos a trav&eacute;s de dos opciones: donaciones en l&iacute;nea y por medio de un formulario que lo contactar&aacute; con nosotros.<br />
</p>
<p align="justify" class="Estilo1"><br />
</p>
<p class="style18">&nbsp;</p> </td>
</tr>
</tbody>
</table>
<p class="style1"><a href="file:///C|/wamp2/www/cenfa2_10abril/index.php">volver</a></p>
<p class="style1">&nbsp;</p>
<p class="style1">&nbsp;</p>
<p class="style1">&nbsp;</p>
<p class="style1">&nbsp;</p>
<blockquote>
<p class="style1"><span class="style151 style18 style18 style18 style18 style18 style18 Estilo2">Bellavista 61, Recoleta. Tel.: 7771025 / 7775419 / 9.4306603</span></p>
</blockquote>
</body>
</html>



archivo2.php

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gracias</title>
</head>

<body>
<p><a href="../index.php"><img src="../imagenes/logochico.jpg" width="210" height="105" border="0" /></a></p>
<div align="center">
<p class="style1">Muchas gracias por comunicarse con CENFA Centro Nacional de la Familia. Muy pronto nos contactaremos con usted.</p>
<p class="style1"><a href="../index.php" class="Estilo19">Inicio</a></p>
</div>
</body>
</html>

<?php
function quitar($mensaje) //elimina simbolos indeseados
{
$mensaje = str_replace("<","&lt;",$mensaje);
$mensaje = str_replace(">","&gt;",$mensaje);
$mensaje = str_replace("\'","'",$mensaje);
$mensaje = str_replace('\"',"&quot;",$mensaje);
$mensaje = str_replace("\\\\","\",$mensaje);
return $mensaje;
}
//////////////////////////////////////////////////
$to = "[email protected]";// "[email protected]"; "[email protected]"; Aca el email donde llegara el mansaje

/* subject */
$subject = "Nuevo voluntario";

/* message */
$message = "Hay un nuevo voluntario para CENFA. El nombre del contacto es: "." ". $_POST['nombre']."<br>";
$message .= "email: "." " .$_POST['mail']."<br>";
$message .= "teléfono: "." " .$_POST['tel']."<br>";
$message .= "fecha: "." " .$_POST['fecha']."<br>";
$message .= "comentario: "." " .$_POST['mensaje']."<br>";


/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "To: <[email protected]>\r\n";//Aca el email donde llegara el mansaje
$headers .= "From: Mensaje Web <[email protected]>\r\n";//Aca deves poner un email del sitio
//$headers .= "Cc: [email protected]\r\n"; //este es con copia
//$headers .= "Bcc: [email protected]\r\n";// este es con copia oculta

mail($to, $subject, $message, $headers);
?>