PDA

View Full Version : Error in output. new user.



Lesjo
01-Dec-2004, 07:44 PM
I am new at this so be kind.

I set up the formmail.php as suggested.
I am using the sample form from the download section.

when I go to submit the sample form, I get this message:

FAILED to send alert message. Check your server error logs.

PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\hshome\valleypr\valleyprintingfargo.com\formmail.php on line 2871

Help?

Lester

russellr
01-Dec-2004, 09:43 PM
Hi,

It seems from the error message that your server wants a valid sender.

Think of an email address you know your server can send from (such as your own); if you've never sent email from your server, then just try your own email address.

On the sample form, enter this email address and submit.

Do you still get the error message?

Lesjo
01-Dec-2004, 09:53 PM
I contacted my host and ran two new scripts to see if the problem was on their end.

Quoting:
To Host: I have installed 2 simple php scripts and neither of them work. Can you tell me why?

attached: testmail.php, testmail2.php

From Host:
That is because you are missing a FROM address in your sendmail script. Please make sure you put in a valid FROM address.

This seems to be the same problem as I get from the sample form for the formmail.php. I went back to the website and ran the situation again, using a different email address, and get the same results.

What next?

russellr
01-Dec-2004, 10:05 PM
Hi,

I assume you put your email address in the value for $ADDR in these test scripts.

If not, do that and test again.

I've attached a third test script. Set $ADDR to your email address and try it.

If that doesn't work, you can reply to your hosting provider with this script and say something like "This script has the FROM specified in 3 places - in the header, in the body, and in the -f option. Why doesn't it work?"

Lesjo
06-Dec-2004, 04:50 PM
I am going 'round and 'round with my hosting service. The latest is that the test scripts still don't work. I am getting the same errors, all pertaining to the FROM address.

Here is a list of the errors pertaining to the individual scripts:

running sample_formmail.htm
-->
An error occurred while processing the form.

Please contact us directly since this form is not working.
We apologize for any inconvenience this error may have caused.



Your form submission was processed by formmail.php (4.08), available from www.tectite.com (http://www.tectite.com/)

PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\hshome\valleypr\valleyprintingfargo.com\formmail.php on line 2871 PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\hshome\valleypr\valleyprintingfargo.com\formmail.php on line 2871

Using testmail.php
-->

Mail function FAILED
PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\hshome\valleypr\valleyprintingfargo.com\testmail.php on line 5

Using testmail2.php
-->
Mail function FAILED with -f parameter
PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\hshome\valleypr\valleyprintingfargo.com\testmail2.php on line 5

using testmail3.php
-->
Mail function FAILED
PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\hshome\valleypr\valleyprintingfargo.com\testmail3.php on line 8

Russell -- I'm stumped.

russellr
06-Dec-2004, 10:18 PM
Hi,

Well testmail3.php provides a From: line in the body, as well as in the header and the -f option too.

If your hosting provider isn't willing to diagnose the problem on the server with this simple script to guide them, then I'd recommend changing hosting providers.

However, I've attached two more test scripts. If neither of these work, I don't know what else to suggest.

These scripts set "sendmail_from" using ini_set - this is what the error message is talking about in the first half of it.

testmail4.php keeps the -f option, testmail5.php has no -f option.

You need to set $ADDR to your email address before running these scripts.

Let me know how you go.

Lesjo
06-Dec-2004, 10:30 PM
Thank you! Thank you! Thank you!

Those both worked!

Now on to better things... making them work with the actual formmail script.

russellr
06-Dec-2004, 10:53 PM
Hi,

That's great.

The next thing to do is see if you can set $ADDR to a different email address. Set it to supportstaff AT tectite DOT com. If I can receive the email then we know that you server is happy to have any From user.

After that, we know what needs to be added to FormMail.

Lesjo
06-Dec-2004, 11:02 PM
I ran testmail5.php to your address. Upon activating the script, I got a successful transmission.

Ball's in your court!

Thanks!
Lester

russellr
06-Dec-2004, 11:15 PM
Hi,

Yes, got it!

So, you need a configuration option in FormMail that calls



ini_set("sendmail_from",emailaddress);


I'll see what we can do...

Lesjo
06-Dec-2004, 11:17 PM
Excellent!

Thanks much!

russellr
08-Dec-2004, 01:31 AM
Hi,

We have a new version of FormMail that supports your ini_set requirement.

Use the Upgrade Wizard here: http://www.tectite.com/wizards/fmupg.php
to upgrade to version 4.09.

Then set the configuration setting "INI_SET_FROM" in formmail.php to true.

Also, set $FROM_USER in formmail.php to be your email address.

Test alerts using the "http:.../formmail.php?testalert=1" feature.

Then test your forms.

Pls let me know how you go with this new version.

Lesjo
08-Dec-2004, 03:48 PM
Russell,

Everything seems to be working to a point. My hat is off to you.
This is further along than I had expected at this point. Tested the new formmail.php 4.09 script
and everything worked fine with the "http:.../formmail.php?testalert=1" feature.
However, when I ran "sampleform.htm" with the new formmail.php script, this is
what I came up with.

***************************************
An error occurred while processing the form.
Our staff have been alerted to the error.
We apologize for any inconvenience this error may have caused.

Your form submission was processed by formmail.php (4.09), available from www.tectite.com (http://www.tectite.com)

PHP Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing
in C:\hshome\valleypr\valleyprintingfargo.com\formmail.php on line 2935
*******************************************************

Upon getting the above message (displayed on screen), I received the following email:
****************************************************

To: webmaster@valleyprintingfargo.com
From: webmaster@valleyprintingfargo.com
The following error occurred in FormMail:
mail_failed

Error=Failed to send email

contact: 'Y'
colors: 'red'
vehicles: 'Car'
mesg: 'This is a test of the new formmail php script using sampleform.htm'
***********************************************

My question to you:
Is there something I am missing in configuring this script? or is there something missing in the program?
Hopeful at last,
Lester

russellr
08-Dec-2004, 09:38 PM
Hi,

Given testmail4 & 5 worked, this should too. I think this means there's an error in your form or FormMail config.

Double check all steps leading to this point. If no progress, please email them both to me at supportstaff AT tectite DOT com.