This is a discussion on "PHP Mail Submit Form Error" within the PHP Forum section. This forum, and the thread "PHP Mail Submit Form Error are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP Mail Submit Form Error
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
PHP Mail Submit Form Error
Hello! I am learning the basics on how to create a feed back form were users can compliment or complain about various subjects by filling in a form, and submitting the data to my email address.
The only problem is when i test the form i get a error messege in the browser explaining i need mail setting configured correctly, i am using XAMMP and and am a bit stuck on how to solve the problem. Below i have displayed my error messege and form & php code. Please help with this problem as a lot of the time when i post no one responds about what am stuck on! Cheers. My error: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\WiKid\send_contact.php on line 23 ERROR My form code:
My PHP Code:
|
|
|
|
#2
|
|||
|
|||
|
Re: PHP Mail Submit Form Error
Quote:
Good Luck, Scott
__________________
Web Design and Development |
|
#3
|
|||
|
|||
|
Re: PHP Mail Submit Form Error
Hello & thanks 4 the reply!
I have changed the variables and i am getting this error messege: Notice: Use of undefined constant subject - assumed 'subject' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 12 Notice: Use of undefined constant detail - assumed 'detail' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 14 Notice: Use of undefined constant customer_mail - assumed 'customer_mail' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 17 Notice: Undefined variable: name in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 19 Bauld Has Just Recieved Yer Winging Assed Complaint Here is how i alterd the variables:
|
|
#4
|
|||
|
|||
|
Re: PHP Mail Submit Form Error
Remember to declare all your variables. Your name variable is not declared, and I think that is where it encounters your error. Add this to the top of your PHP file.
Also restructure your file like this:
Scott
__________________
Web Design and Development |
|
#5
|
|||
|
|||
|
Re: PHP Mail Submit Form Error
Ok I have decalred all the variables and still no luck!!
Its doin me head in!! Below is my erorrs still: Notice: Use of undefined constant name - assumed 'name' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 11 Notice: Use of undefined constant subject - assumed 'subject' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 15 Notice: Use of undefined constant detail - assumed 'detail' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 17 Notice: Use of undefined constant customer_mail - assumed 'customer_mail' in e:\domains\s\sexyencounters.net\user\htdocs\send_c ontact.php on line 20 Bauld Has Just Recieved Yer Winging Assed Complaint Below is my php file called: send_contact.php
contact.php
|
|
#6
|
|||
|
|||
|
Re: PHP Mail Submit Form Error
Most developers put all the php processing instructions before any html. I would place all variables and processing instructions at the top of your document. Then echo a variable that contains the message either successful or unsuccessful. Also the use of a variable named header may be producing an error as header is a php function.
__________________
Web Design and Development |
|
#7
|
|||
|
|||
|
Re: PHP Mail Submit Form Error
I think you may be better testing this live as your host will have the mail function set up and you will be able to see the errors you really need sorting.
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] parse error, unexpected T_EXIT in php mail script | Posie | PHP Forum | 8 | Dec 13th, 2007 14:21 |
| PHP Form returns error : mail expects most 5 parameters? | shifty | PHP Forum | 5 | Sep 30th, 2007 21:07 |
| Mail Form help! | ClrWtrDsgnr | PHP Forum | 6 | Sep 27th, 2007 21:22 |
| submit many forms - auto submit the same form many times | divs | JavaScript Forum | 0 | May 24th, 2007 10:10 |
| visitors name not displayed in mail after filling in mail form | made on earth | PHP Forum | 7 | Nov 16th, 2005 22:43 |