views:

195

answers:

1

I am trying to send email using PHP mail. I get the following error:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/home/webtest/help/ask_us.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

The PHP code is as follows:

<?php
  $name = $_REQUEST['name'] ;
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ; 
  $message = $_REQUEST['message'] ;

  mail( "[email protected]", "Subject header",
    $message, "From: $email" );
  header( "Location: http://www.google.com" );
?>
+4  A: 

That message isn't a mail error. PHP cannot open the file ask_us.php. If ask_us.php is your file, check its permissions (and those of the parent folders).

Vinko Vrsalovic