Ver Mensaje Individual
  #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