Page 1 of 1

PHP - Submit Form

PostPosted: 20. November 2007 22:31
by StickerAA
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.

PostPosted: 20. November 2007 22:47
by Wiedmann
when I click submit my error message returns.

What is your error message?

PostPosted: 20. November 2007 23:43
by StickerAA
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

PostPosted: 21. November 2007 02:24
by Wiedmann
/** 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.

PostPosted: 21. November 2007 03:19
by StickerAA
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]

PostPosted: 21. November 2007 03:42
by Wiedmann
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().

PostPosted: 21. November 2007 15:17
by StickerAA
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