Tengo una página llamada final.php en la cual tengo una serie de variables que quiero enviar por mail a través de una página llamada c.php que me valida la información y así mismo envía el mail que es un archivo llamado contactocorreo.htm. Es decir este último archivo (contactocorreo.htm) es el que el cliente recibe en su correo. Pero aún no logro que se envíe el mail, mis códigos son:
en final.php
<form action="c.php" method="post" name="form1" target="_blank">
<?php echo $_GET['COrigen'] ?> ETC PARA MIS VARIABLES
<input name="CDestino" type="hidden" value="[email protected]">
<input type="submit" name="Submit" value="Confirm">
en c.php
<?php
$mensaje = "";
function check ($sting, $type) {
if (strlen ($sting) > 128) {return 0;}
if (strlen ($sting) > 64 and $type = 1) {return 0;}
if (strstr($sting, ":")) {return 0;}
if (strstr($sting, ",")) {return 0;}
if (strstr($sting, ";")) {return 0;}
if ($type == 1 and !strstr($sting, "@")) {return 0;}
return 1;
}
// Verificamos que el correo de origen sea adecuado
$mensaje_correo = implode ("", file ("./contactocorreo.htm"));
$ArregloVariables = array (
"CCName",
"CCAddress",
"COrigen",
"CCCountry",
"CCCity",
"CCAirline",
"CCFlight",
"CCLicense",
"CCMobile",
"CCComments",
"CCMobile",
"CCPayment",
"CCAuto",
"CCPickUp",
"CCReturn",
"CCRent",
"CCSubtotal",
"CCTotal",
"CCFoto");
while (list ($key, $value) = each ($ArregloVariables)) {
$mensaje_correo = ereg_replace ($value, $$value, $mensaje_correo);
}
$mime_part = "\n\n------=_NextPart_000_00D6_01C1D05E.70304780\nContent-Type: text/html;\n charset=\"iso-8859-1\"\n";
$mensaje_correo = $mime_part . $mensaje_correo;
if ($mensaje == "") {
mail($CDestino,
$CTitulo,
$mensaje_correo,
"From: $COrigen\n" .
"Reply-To: $COrigen\n" .
"X-Mailer: Benkio\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative;\n" .
" boundary=\"----=_NextPart_000_00D6_01C1D05E.70304780\"");
mail($COrigen,
$CTitulo,
$mensaje_correo,
"From: $CDestino\n" .
"Reply-To: $CDestino\n" .
"X-Mailer: Benkio\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative;\n" .
" boundary=\"----=_NextPart_000_00D6_01C1D05E.70304780\"");
$mensaje = "Your mail was sent. We will contact you soon";
}
?>
en contactocorreo.htm
<td width="86"> <?php echo $_GET['CCName'] ?> </td>
<td width="210" bgcolor="#A8C6A8">E-mail:</td>
<td width="136"><?php echo $_GET['COrigen'] ?></td> ETC PARA CADA UNA DE MIS VARIABLES
GRACIAS!!!!!