Foros del Web » Programando para Internet » PHP »

problema con la funcion mail

Estas en el tema de problema con la funcion mail en el foro de PHP en Foros del Web. hola tengo un script para enviar mails, pero al problarlo el servidor me arroja este error. lo eh probado tambien en otro servidor y funciona ...
  #1 (permalink)  
Antiguo 31/01/2008, 10:09
p2pdownloading
Invitado
 
Mensajes: n/a
Puntos:
problema con la funcion mail

hola tengo un script para enviar mails, pero al problarlo el servidor me arroja este error. lo eh probado tambien en otro servidor y funciona bien.

como puedo solucionar este problema o que otros scripts podria usar ??


Warning: mail() [function.mail]: SAFE MODE Restriction in effect. The mail() command is not allowed. in /www/zxq.net/c/a/d/cadena-de-links/htdocs/email.php on line 36
Your email has been sent to ,,[email protected], from [email protected]


Código PHP:
<?php
if(@isset($_POST['submit'])) {
// require fields...look at the hidden field to change what's required
   
$required_fields explode(","$_POST['required']);

   
$error 0;

  foreach(
$required_fields as $fieldname) {
     if (
$_POST[$fieldname] == "") {
        
$error++;
     }
  }


   if (
$error == 0) {
      if (
strstr($_POST['to'], "@") and strstr($_POST['to'], ".")) {
          if (
strstr($_POST['from'], "@") and strstr($_POST['from'], ".")) {
// headers to be included in email
        
$headers .= "MIME-Version: 1.0\n"
// html header (delete the following row if you do not want html to show)
        
$headers .= "Content-type: text/html; charset=iso-8859-1\n"
// from header
        
$headers .= "From: $_POST[name] <$_POST[from]>";
// mail function
         
mail("$_POST[to]" "$_POST[subject]"$_POST[message], $headers);

// success message
// if you receive a php error, make sure your server is set up to send email
      
print "<b><font size=2>Your email has been sent to $_POST[to] from $_POST[from]</font></b>";
      exit;

          } 
      } else { 
         
$errormessage "<b><font color=red>The email address you entered does not appear to be valid.</font><br></b>";
      }


   } else {
      
$errormessage "<b><font color=red>You have left some required fields in the form blank. Please fill in the form completely.</font><br></b>";
   }
}
?>
saludos
  #2 (permalink)  
Antiguo 31/01/2008, 10:15
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Re: problema con la funcion mail

Esta diciendo que por razones de seguridad la persona(s) encargadas de tu hosting deshabilitaron el uso de la función mail().

Si deseas usarla, tendrás que ponerte en contacto con ellos para que habiliten la función mail.

Saludos.
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 08:04.