PHP - Submit Form

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP - Submit Form

Postby StickerAA » 20. November 2007 22:31

My Xampp and PHP is on localhost (personal computer) as a developement platform

I created a test form requesting Name: Subject: and Message:

when I click submit my error message returns.

I have edited the php.ini in 3 locations: 1)c:\xampp\php
2)c:\xampp\php\php4 and 3)c:\xampp\apache\bin

All other configurations are default when Xampp was installed.
The only services running are Apache and MySql.
I would like to retrieve the email via Outlook

[mail function]
; For Win32 only.
SMTP = my_in_out_server /** the same setup as Outlook
smtp_port = 25

any and all suggestions are appreciated. If needed I can post my ".php" script.
StickerAA
 
Posts: 4
Joined: 20. November 2007 22:12

Postby Wiedmann » 20. November 2007 22:47

when I click submit my error message returns.

What is your error message?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby StickerAA » 20. November 2007 23:43

It is the error message generated by my form:

/** if the mail function fails, we show that result **/

else
echo "Message failed to send";

Message failed to send
StickerAA
 
Posts: 4
Joined: 20. November 2007 22:12

Postby Wiedmann » 21. November 2007 02:24

/** if the mail function fails, we show that result **/

- You call the mail function with "@mail()" and not with "mail()"?
- error_reporting is on?
- display_errors is on?

echo "Message failed to send";

Your own "error message" is not helpful ;-) Only the original error message from PHP can give a hint.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby StickerAA » 21. November 2007 03:19

lol... after I posted the message and continued to fiddle with it i realized that by turning error_reporting off was not doing any good...

This is php's error message:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\testing\tutorial\mail1.php on line 97

However, when I changed mail() to @mail() that message didn't show anymore but my error message did:

Message failed to send

Now, I have spent most of the day researching and I wonder if I need to setup a mail server on my pc to test this.[/quote]
StickerAA
 
Posts: 4
Joined: 20. November 2007 22:12

Postby Wiedmann » 21. November 2007 03:42

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\testing\tutorial\mail1.php on line 97

I think this message is clear. You have two options:
1) edit your "php.ini" and enable "sendmail_from" with a valid value.
2) or set the "From" - Header in the fourth parameter for mail().
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby StickerAA » 21. November 2007 15:17

Thanks for your help. I set up mercury32 and the script works but the mail does get to me.

Outlook connects to localhost and checks for mail but none is there.

Back to the drawing board.

Sticker
StickerAA
 
Posts: 4
Joined: 20. November 2007 22:12


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 42 guests