I'm very new to php and html forms, but I just want a simple form that sends an email from one of my gmail addresses to my other, with a person's email, name and comments. Below is the code I have tried, made from little bits of code from the web, but it doesn't work - at least not in my browser, G Chrome 14.0. When I press "Submit" I just see the php code, it doesn't run, it doesn't send an email.
I'm not sure if this will help, but both email addresses are gmail
HTML Form:
- Code: Select all
<form name="input" action="sendMail.php" method="get">
Your email: <br/><input type="text" name="email" /><br/>
Your name: <br/><input type="text" name="message" /><br/>
Comments/questions: <br/><textarea cols="40" rows="5" name="comments">
</textarea><br/>
<input type="submit" value="Submit" />
PHP Code:
- Code: Select all
<? PHP
$message1 = $_GET['email'];
$message2 = $_GET['message'] ;
$message3 = $_GET['comments'];
$message = "Email: $message1\nLanguage: \nComments / Questions: $message3";
$email = "my-other-email-address@gmail.com";
mail( "my-email-address@gmail.com", "Language suggestion: $message2", $message, "From: $email" );
print "Your form has been submitted, click ";
print "<a href=\"http://www.mywebsite.com\">here</a>" ;
print " to return to the main page";
?>


