google app engine php code

95 Views Asked by At

I have deployed my application on google app engine .The input entered by the user on the form invokes the email.php file(mentioned below in the code) to send out an email . However, when I deploy this ,when the php file(email.php) is being called the script is not executed and the the script is being displayed in the localhost. I have read the other posts on configuring the app.yaml file it does not help. Let me know what has to be done.

app.yml

application: shop_app  
version: alpha-001  
runtime: php55  
api_version: 1  
handlers:  
-url: /email.php  
script: assets/email.php      

.php file

<?php  
  $name = $_POST['fname'];  
  $lname = $_POST['lname'];  
  $email_address = $_POST['email'];  
  $phone = $_POST['phone'];  
  $message = $_POST['message'];  

  // Create the email and send the message  
  $to = '[email protected]'; 
  $email_subject = "Website Contact Form:  $name";  
  $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nFirst Name: $name\n\nLast Name:$lname\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n\n$message";               
  $headers = "From: [email protected]\n"; // This is the email address the generated message will be from. We recommend using something like [email protected].
   $headers .= "Reply-To: $email_address";    
  mail($to,$email_subject,$email_body,$headers);  

  /* Redirect browser */  
  header("Location: index.html");  
?>
0

There are 0 best solutions below