I have designed two forms, first one is feedbackform.html and the second one is messagesent.php.
When someone fills in the feedbackform and clicks submit, it gives the message that Thank you for message. We will respond as soon as we can. My feedback form is suppose to send me the comments to my email address but unfortunately it doesn't do that. I have checked my code again and again but can't see what I have done wrong.
Following is the code for my feedbackform.html:
My code for the messagesent.php is as follows:Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> Website comments/Suggestions <form id="frm_message" name="frm_message" method="post" action="messagesent.php"> <table width="482" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2">Website comments/Suggestions </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Your email address </td> <td><input name="emailaddress" type="text" id="emailaddress" size="55" /></td> </tr> <tr> <td>Subject</td> <td><label> <input name="subject" type="text" id="subject" size="55" /> </label></td> </tr> <tr> <td>Comments</td> <td><textarea name="textarea" cols="55"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Submit" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> <p> <!-- Website Contact Form Generator --> <!-- http://www.tele-pro.co.uk/scripts/contact_form/ --> <!-- This script is free to use as long as you --> <!-- retain the credit link --> </p> </body> </html>
Would someone help me please. Check the above two and see where I am going wrong.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <p> <?php mail($_POST['jtanna1@gamil.com'], $_POST['subject'], $_POST ['textarea']); ?> </p> <p>Thank you for message. We will respond as soon as we can. </p> </body> </html>
Thanks in advance.
Jay
Id hate for this to be the problem but, is your address a gmail account? or gamil account? lol
No I used the school email address and it didn't work. This morning I put gmail address and it did work so I don't understand why it wouldn't work with the other addresses.
Sorry I noticed that you were just referring to the spelling mistake. With the correct gmail address it does work, but doesn't work with hotmail or the school email address. I am certain that I have not got a spelling mistake.
Last edited by tannajay; 1st May 2008 at 12:34 PM.

Well spotted that man![]()
Hm, thats interesting, why dont you try printing the contents of your $_POSTS to try to debug?
Have you managed to get any other of your PHP scripts to send an email?
There is some settings in the php.ini file you need to set before you can send mail using a PHP script.
I set these in the PHP script where I need it to send an email:
ini_set('SMTP','email server address');
ini_set('smtp_port','25');
ini_set('sendmail_from','somename@someemailaddress .com');
Last edited by Shane; 1st May 2008 at 01:03 PM.
Are you running on IIS and windows server?
Your call to the mail function appears to be wrong in messagesent.php, you are passing a variable to it that has not been declaired: $_POST['jtanna1@gamil.com']
It should read something like:
Take a look here for more info on the mail function.Code:mail('jtanna1@gmail.com', $_POST['subject'], $_POST['textarea'], 'From: '.$_POST['emailaddress']."\r\n");
Hope that is of some help,
Iain
There are currently 1 users browsing this thread. (0 members and 1 guests)