Foros del Web » Programando para Internet » PHP »

Ayuda con formulario para servidor linux

Estas en el tema de Ayuda con formulario para servidor linux en el foro de PHP en Foros del Web. Hola quisiera que me puedan ayudar tengo un gran problema, tengo un formulario que en un servidor windows me funciona a la perfeccion, pero en ...
  #1 (permalink)  
Antiguo 25/05/2010, 18:19
 
Fecha de Ingreso: mayo-2010
Mensajes: 2
Antigüedad: 14 años
Puntos: 0
Busqueda Ayuda con formulario para servidor linux

Hola quisiera que me puedan ayudar tengo un gran problema, tengo un formulario que en un servidor windows me funciona a la perfeccion, pero en un servidor linux no me envia el mail, quisiera saber si me pueden ayudar a revisarlo y ver que cosas son las que tengo que modificar para que funcione.

Bueno espero me puedan ayudar

Código PHP:
<?



// #### CONFIGURE FROM: ADDRESS ##############################################


$from_address "[email protected]";

// #### ACTIVATE REQUIRED FIELDS? ############################################


$required_on "yes";
$required_errorpage "error.html";

// ###########################################################################


// #### OVERRIDE REQUIRED VARIABLES? #########################################

$override "no";


// Enter the email address(es) to send the email to.
$incoming_mailto ="[email protected]";

// Enter the email subject.
$incoming_subject "You have a new message from Contact Form of";

// Enter the thank you page URL.
$incoming_thanks "thanks.html";


// #### BAN IP ADDRESSES? ####################################################

$ban_ip_on "no";


$ban_ip_list "111.222.33.55,11.33.777.99";

// #### ACTIVATE DOMAIN SECURITY? ############################################

$secure_domain_on "no";


// #### ACTIVATE AUTO-RESPONSE? ##############################################

$autorespond_on "yes";


// The following setting is the subject of the auto-response email:
$autorespond_subject "Gracias por contactarnos";

// The following setting is the from-address of the auto-respond email:
$autorespond_from ="[email protected]";

// The following setting is the message of your auto-response email:
$autorespond_contents "Hemos recibido su mensaje satisfactoriamente. 
Nos contactaremos con usted a la brevedad. 
Muchas Gracias.  

www.eurotek.cl"
;


$autorespond_mailto_field "r_Email";





// MAKE SURE DYNAFORM IS NOT BEING LOADED FROM THE URL
if($HTTP_SERVER_VARS['REQUEST_METHOD'] == "GET") {
echo 
"
<html>
<head><title>Contact PHP Form is installed correctly.</title></head>
<body>
<font style='font-family: verdana, arial; font-size: 9pt;'>
<b>Contact Form is installed correctly.</b></font><br>
<font style='font-family: verdana, arial; font-size: 8pt;'>
Form Easy PHP Form Mailer was created by <a href='http://www.ideaproducciones.com'>Ideaproducciones.com Hosting</a>.
</font>
</body></html>
"
;
exit();
}

// SET VARIABLES
$incoming_fields array_keys($HTTP_POST_VARS);
$incoming_values array_values($HTTP_POST_VARS);

if(
$override == "no") {
$incoming_mailto = @$HTTP_POST_VARS['rec_mailto'];
$incoming_subject = @$HTTP_POST_VARS['rec_subject'];
$incoming_thanks = @$HTTP_POST_VARS['rec_thanks'];
}

$incoming_mailto_cc = @$HTTP_POST_VARS['opt_mailto_cc'];
$incoming_mailto_bcc = @$HTTP_POST_VARS['opt_mailto_bcc'];
$form_url = @$HTTP_REFERER;

// BEING RUN FROM THE RIGHT DOMAIN
if($secure_domain_on == "yes") {
$form_url_array parse_url($form_url);
$form_domain $form_url_array[host];
if(
$form_domain != $HTTP_SERVER_VARS[HTTP_HOST]) {
echo 
"<h2>Form Error - Invalid Domain</h2>

<br><br>"
;
$error "yes";
}
}

// CHECK IF MAILTO IS SET
if($incoming_mailto == "") {
echo 
"<h2>Form Error - Missing Field</h2>
Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
the required \"<b>rec_mailto</b>\" field within the form. This field specifies who the email will
be sent to.
<br><br>
This should look like:<br>
<input type=\"hidden\" name=\"rec_mailto\" value=\"[email protected]\">
<br><br>
If you are still confused, please refer to the readme.txt for more information and examples.<br><br><br><br>
"
;
$error "yes";
}

// CHECK IF SUBJECT IS SET
if($incoming_subject == "") {
echo 
"<h2>Form Error - Missing Field</h2>
Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
the required \"<b>rec_subject</b>\" field within the form. This field specifies the subject of
the email that will be sent.
<br><br>
This should look like:<br>
<input type=\"hidden\" name=\"rec_subject\" value=\"New Form Email\">
<br><br>
If you are still confused, please refer to the readme.txt for more information and examples.<br><br><br><br>
"
;
$error "yes";
}

// CHECK IF THANKS IS SET
if($incoming_thanks == "") {
echo 
"<h2>Form Error - Missing Field</h2>
Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
the required \"<b>rec_thanks</b>\" field within the form. This field specifies what page the user
will be taken to after they submit the form.
<br><br>
This should look like:<br>
<input type=\"hidden\" name=\"rec_thanks\" value=\"thanks.html\">
<br><br>
If you are still confused, please refer to the readme.txt for more information and examples.<br><br><br><br>
"
;
$error "yes";
}

// CHECK IF IP ADDRESS IS BANNED
if($ban_ip_on == "yes") {

if(
strstr($ban_ip_list$HTTP_SERVER_VARS[REMOTE_ADDR])) {
echo 
"<h2>Form Error - Banned IP</h2>
You cannot use this form because your IP address has been banned by the administrator.<br>
"
;
$error "yes";
}
}


if(
$error == "yes") {
exit();
}

// SET EMAIL INTRODUCTION
$message "Este Email es desde el formulario de Contacto Ubicado en $form_url \n\n";

// LOAD EMAIL CONTENTS 
for ($i 0$i count($incoming_fields); $i++) { 
if(
$incoming_fields[$i] != "rec_mailto") {
if(
$incoming_fields[$i] != "rec_subject") {
if(
$incoming_fields[$i] != "rec_thanks") {
if(
$incoming_fields[$i] != "opt_mailto_cc") {
if(
$incoming_fields[$i] != "opt_mailto_bcc") {

// CHECK FOR REQUIRED FIELDS IF ACTIVATED
if($required_on == "yes") {
$sub substr($incoming_fields[$i], 02);
if(
$sub == "r_") {
if(
$incoming_values[$i] == "" OR !isset($incoming_values[$i]) OR $incoming_values[$i] == " ") {
header("Location: $required_errorpage");
exit();
}}}

// ADD FIELD TO OUTGOING MESSAGE
$message .= "$incoming_fields[$i]:\n$incoming_values[$i]\n\n";
}}}}}}

// SET EMAIL FOOTER
$message .= "";

// CLEAR HEADERS
$headers "";

// ADD FROM ADDRESS
if($from_address != "") {
$headers .= "From: $from_address\r\n";
}

// CHECK FOR CC OR BCC
if($incoming_mailto_cc != "") {
$headers .= "Cc: $incoming_mailto_cc\r\n";
}
if(
$incoming_mailto_bcc != "") {
$headers .= "Bcc: $incoming_mailto_bcc\r\n";
}

// SEND EMAIL
mail($incoming_mailto$incoming_subject$message$headers);

// SEND AUTO-RESPONSE IF ACTIVATED
if($autorespond_on == "yes") {
$autorespond_mailto = @$HTTP_POST_VARS[$autorespond_mailto_field];
$autorespond_headers "From: $autorespond_from";
mail($autorespond_mailto$autorespond_subject$autorespond_contents$autorespond_headers);
}

// FORWARD TO THANK YOU PAGE
header("Location: $incoming_thanks"); 


?>
  #2 (permalink)  
Antiguo 25/05/2010, 18:39
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 9 meses
Puntos: 1532
Respuesta: Ayuda con formulario para servidor linux

pueden ser varias razones: es sabido que para windows se necesita un smtp, para GNU/linux prácticamente no hace falta pero si lo desistalas o tienes bloqueado el puerto 25 para salida en el firewall o el servicio/demonio del smtp, no puede enviar emails
  #3 (permalink)  
Antiguo 25/05/2010, 18:55
 
Fecha de Ingreso: mayo-2010
Mensajes: 2
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda con formulario para servidor linux

mayco, lo que pasa es que me gustaria que me puedan ayudar a revisarlo para dejarlo funcionando.
Gracias por la respuesta

Etiquetas: haganme_mi_tarea
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:56.