Click to See Complete Forum and Search --> : What is wrong with this??!?!?!?


CKS
01-06-2008, 05:14 PM
Hi all, new here. Joined up because I cannot for the life of me get this file working. Im sure you are aware of the FormMail.cgi script from Matts Script Archive. Well anyways. I keep getting the problem.. "Error: Bad/No Recipient
There was no recipient or an invalid recipient specified in the data sent to FormMail. Please make sure you have filled in the recipient form field with an e-mail address that has been configured in @recipients. More information on filling in recipient form fields and variables can be found in the README file."

Checked over all documentation for a good few hours now and not getting anywhere.

Got the following in the cgi file,

"@referers = ('scriptarchive.com','195.224.48.71', 'www.moremoney.me.uk','hotmail.com');

@recipients = &fill_recipients(@referers,'cks_cropper@hotmail.com');"

Then with the following in the HTML file of the form....

"<input type=hidden name="recipient" value="cks_cropper@hotmail.com"/>

<input type=hidden name="subject" value="KleenezeLead"/>

<input type=hidden name="required" value=""/>

<input type=hidden name="redirect" value="confirm.html">"

Gggrrrrrrr. Am I being blind here, or what? Can anyone help me solve this problem?

Thanks
CKS

fahlyn
01-07-2008, 05:33 AM
what does your fill_recipients function look like? I'm wondering if you need to change this:


@recipients = &fill_recipients(@referers,'cks_cropper@hotmail.com');


to this:


@recipients = &fill_recipients(\@referers,'cks_cropper@hotmail.com');


If that doesn't work, post your fill_recipients code and I'll take a look at that.

CKS
01-07-2008, 11:17 AM
Just tried that one, but still getting the same error.

Here is the code you asked for...

"# This was added into v1.91 to further secure the recipients array. Now, by #
# default it will assume that valid recipients include only users with #
# usernames A-Z, a-z, 0-9, _ and - that match your domain exactly. If this #
# is not what you want, you should read more detailed instructions regarding #
# the configuration of the @recipients variable in the documentation. #
sub fill_recipients {
local(@domains) = @_;
local($domain,@return_recips);

foreach $domain (@domains) {
if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/) {
$domain =~ s/\./\\\./g;
push(@return_recips,'^[\w\-\.]+\@\[' . $domain . '\]');
}
else {
$domain =~ s/\./\\\./g;
$domain =~ s/\-/\\\-/g;
push(@return_recips,'^[\w\-\.]+\@' . $domain);
}
}

return @return_recips;
}"

Thanks
CKS