PDA

View Full Version : Formmail Help



Nic
10-14-2005, 11:39 AM
Ok i have searched the forums for help on this and recieved plenty of help but i have came to a dead end trying to get it to work. I have no expierence with Perl so Im learning as I go.

Im having issues where im getting "Error: Bad/No Recipient". I have read the read me and it said to edit the @recipients part in the script. (Not using te Site Manager to edit i am using a Perl Editor)

I only want to send the information to 1 email address which is the main email for the domain.

These are the lines i have tried in the script:
@recipients = &fill_recipients('name@domain.com')
@recipients = &fill_recipients('name\@domain.com')
@recipients = &fill_recipients('^name\@domain.com')
@recipients = &fill_recipients('^name@domain.com')
@recipients = &fill_recipients('domain.com')


Do you see or know what i could be doing wrong? Any help will be much appreciated.

Cheddarmakerman
10-14-2005, 01:28 PM
here you go:

@recipients = ('^name@domain\.com');

Nic
10-14-2005, 03:17 PM
here you go:

@recipients = ('^name@domain\.com');

Still getting "Error: Bad/No Recipient"

Tried what you did and even tried

@recipients = ('^name\@domain\.com') which is another example it the readme

Getting frustrated with this been working on it for a week

Is anything else needed to be added to the array? Im only setting this up for one domain but at the moment I am clueless when it comes to Perl and learning it as I go along.

Is there anything else that would cause this error to occur?

torrin
10-15-2005, 10:22 AM
According to the documentation this is how it should be done.


@recipients = (&fill_recipients('domain.com','sub.domain.com'),
'^otheruser1@otherhost\.com',
'^otheruser2@otherhost\.com');

Maybe that fill_recipients thing has to be there.

http://www.scriptarchive.com/readme/formmail.html#setting_up

torrin
10-15-2005, 10:25 AM
Also, when you created your form, did you define recipient? Something like what I have typed below.


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

Nic
10-15-2005, 12:55 PM
According to the documentation this is how it should be done.


@recipients = (&fill_recipients('domain.com','sub.domain.com'),
'^otheruser1@otherhost\.com',
'^otheruser2@otherhost\.com');

Maybe that fill_recipients thing has to be there.

http://www.scriptarchive.com/readme/formmail.html#setting_up

I have followed everything on the readme to the "T" and have tried everything it suggested and im still getting the error thats why im so stumped.

These are the ones i have tried plus every combination.



@recipients = &fill_recipients('name@domain.com')
@recipients = &fill_recipients('name\@domain.com')
@recipients = &fill_recipients('^name\@domain.com')
@recipients = &fill_recipients('^name@domain.com')
@recipients = &fill_recipients('domain.com')


This is the line in my form code

<input type="hidden" name="recipient" value="name@domain.com">

I thought maybe that the file gor corrupted or something during the dit process so I shelled into it and ran dos2unix on the FormMail.pl file and now im getting a 403 error when trying to submit the information.

Anyone know why this would happen?

I really dont want to try something else I would rather tackle Formmail and win this battle but if i go any longer with this im bound to go insane.

Cheddarmakerman
10-17-2005, 08:17 AM
Sounds like your install has been corrupted. Try uninstalling and reinstalling. I just tried and it works great for me. Here is what I have:

test_form.html:

<html>
<head>
<title>FormMail Test</title>
</head>

<body>
<form action="http://domain.whsites.net/cgi-bin/formmail/FormMail.pl" method="post">
<input type="hidden" name="recipient" value="user@domain.whsites.net">
<input type="text" name="text">
<input type="submit" value="Submit">
</form>
</body>
</html>

FormMail.pl:

@recipients = ('^user@domain\.whsites.net');

Nic
10-17-2005, 11:35 AM
Thanks! I have been working on that for like a week. I findly discovered what was causing the error(i think).

I was working with a form that someone else made and the form they created had

<form action="http://www.domain.com/cgi-bin/formmail/FormMail.pl" method="POST" enctype="multipart/form-data" name="ContactUs" id="ContactUs">

I'm guessing the reason that I was getting the "Error: Bad/No Recipient" was due to that line of code in the form since when I took it out and just used what you had used and it took me to the page where it tells you the information that was sent.

Nic
10-17-2005, 12:53 PM
1 more quick question... How do I go about mkaing it have a from field? Spamassassin is marking it as spam.

rolling
02-22-2006, 11:07 AM
You need to define two fields "email" and "realname". For example add the following two lines to your form

<INPUT TYPE=text NAME="email" VALUE="Enter your email address" SIZE=40>

Enter your name here:
<INPUT TYPE=text NAME="realname" SIZE=50>:

The only trouble with FormMail is that spambots will pick up your email address from the form unless you take steps to hide it using Java or a hashed version of the "recipient" :-(

Richard