Forum Moderators: coopster & phranque

Message Too Old, No Replies

CGI error message

malformed header from script. Bad header=Recipient names must be specif:

         

macnab

2:15 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



I am trying to get a CGI script to work

The result I keep getting is

“Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@teamhosts.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.27 Server at www.bellevuevilla-orlando.com Port 80”

The error log reads,

“malformed header from script. Bad header=Recipient names must be specif:”

Can anyone tell me what this might mean?

coopster

3:16 pm on Jul 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, macnab!

Is this a mailer-type script?

macnab

3:38 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



Hi Coopster - thanks
Yes - I have tried adding the -t to the sendmail(which is not in the path specified by the host) and this gets me through to the "success" page but I do not receive the emails

coopster

3:51 pm on Jul 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



OK, so at least you are getting past your error message now, correct?

macnab

4:06 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



Correct - but still no emails

coopster

4:14 pm on Jul 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



at the command prompt, type in
whereis sendmail
to see the path to your sendmail program and make sure that is the path being used in your script. It is probably something like
/usr/sbin/sendmail
.

macnab

4:55 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



I don't know how to do the above but the support page at the host says

What is the path to Sendmail?

Sendmail is located at /usr/sbin/sendmail.

coopster

5:06 pm on Jul 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That is the path you should use then to send your email.
my $sendmailpath = '/usr/sbin/sendmail'; 
my $To = 'me@mysite.com';
my $From = 'me@mysite.com';
my $Subject = "This is the subject";
open (MAIL, "¦$sendmailpath -t");
print MAIL "To: $To\nFrom: $From\n";
print MAIL "Subject: $Subject\n";
print MAIL "Here is the body.\n";
close (MAIL);

If you copy and paste code from WebmasterWorld, remember that the pipe symbol gets changed and you will need to rekey it using your keyboard!

Philosopher

5:07 pm on Jul 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure you have the recipient address specified correctly? This is usually a hidden variable that is set in the form itself, although some custom scripts have it set within the scripting code itself.

ex.

<input type=hidden name=recipient value=email@host.com>