Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/11/2009, 12:43
dereck2383
 
Fecha de Ingreso: noviembre-2009
Mensajes: 24
Antigüedad: 14 años, 6 meses
Puntos: 0
Configurar contact.php para mandar emails desde formulario

Hola tengo un problema con mi contact.php, no se como configurarlo para que dentro de mi pagina en flash el formulario de correo pueda enviar autoresponders a quien contacte conmigo, los autoresponders funcionan si lo hacen directamente desde el mail pero si lo hacen desde el formulario de mi pagina flahs los utoresponders nunca se envian.

Aqui les dejo el archivo haber si alguien es tan amable de ayudarme a solventar el problema.

Gracias y salu2!!



<?php
//-----------------Getting data sent by flash---------------------
foreach ($_POST as $key => $value){

if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){

$mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>';

$mail_body .= ''.stripslashes($value).'<br/>';
}
}
//-----------------------------------------------------------------



$message = '<html><body>'.$mail_body.'</body></html>'; // mail body

//------------if plain text is set to true removing html tags------
if ($_POST['plain_text']=='true') {

$message = str_replace('<br/>',"\n", $message);

$message = strip_tags($message);

//------------------------------------------------------------------
} else {
//----otherwise composing message headers---------------------------
$headers = 'MIME-Version: 1.0' . "\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
//------------------------------------------------------------------
}

//------------setting conf data-------------------------------------
$to = $_POST['mail_to'];

$from = $_POST['mail_from'];

$subject = $_POST['mail_subject'];

$smtp_server = $_POST['smtp_server'];

$smtp_port = $_POST['smtp_port'];
//------------------------------------------------------------------

//---------setting header info--------------------------------------
$headers .= 'To: '.$to. "\n";

$headers .= 'From: Site visitor ' .$from. "\n";
//------------------------------------------------------------------


if (mail($to, $subject, $message, $headers)){ // sending mail

print('&mail=1'); //succes

} else {

print('&mail=0');//failure

}

?>