cancel
Showing results for 
Search instead for 
Did you mean: 

Formmail (PHP)

BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Formmail (PHP)

I am new to building websites and, at present, have limited technical knowledge. I have to put a form onto a number of pages on the site. I have been asked to use formmail for the collection and transfer of email addresses received from site visitors.
F9 have tried to help with ensuring the software works but have limited PHP knowledge. When I try to send a completed form I obtain an error message = "'Error Bad/No Recipient message - 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 recipients form fields and variables can be found in the README file at http://www.scriptarchive.com/readme/formmail.html." ; My present code is on the following URL http://www.linicconsultants.co.uk/planning_permission.html.
If anyone can help me with this I would be most grateful. Thanks
BarrieF
16 REPLIES 16
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: Formmail (PHP)

The names of the fields are crucial - you've changed them. You should only change the values.
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)

Thanks Jelv
I will review the code....
Regards
Barrie
BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)

Your a star Jelv formmail is now working!
Thanks again.
Barrie
BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)


I thought that the problems of getting FormMail working had been resolved with the excellent input from Jelv. However it appears there is still a glitch in the process somewhere. I can now fill in the required fields in the form and submit I obtain a thank you page that provides details of the field entries and destination email address.
Unfortunately, it doesn't appear to be delivered to the outlined email address, the information appears to disappear into the ether. The form code is on www.linicconsultants.co.uk/planning_permission.html. Does anyone have any ideas how to resolve this issue?
Many thanks
Barrie Faulkner
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: Formmail (PHP)

I'm not sure where you are wanting the results to be sent - if it is gill and barrie they should both be in recipient separated by a comma.
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)

Hello Jelv
Thanks for getting back, apologies for not replying sooner I have been away....
In the form code I have two lines that begin with 'input type="hidden"' and 'name="recipient"'. These lines are separated by a third line with the name="subject" value.
When I submit the form the 'thank you' message says "you submitted to gill@linicconsultants.co.uk,barrie@linicconsultants.co.uk" so that all seems OK. It also lists out the results for each completed field correctly, i.e. first_name: xxxx, email_address: yyyy and submit: submit.
Its just that the information does not seem to be received by the relevant email addresses, it just seems to disappear into the ether.
Regards
Barrie
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: Formmail (PHP)

You could try changing the recipient names to something@yourusername.plus.com
It may be that as a an anti-spamming measure the script is set to allow Plusnet email addresses only.
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
SteveA
Community Veteran
Posts: 1,794
Thanks: 101
Fixes: 3
Registered: ‎17-06-2007

Re: Formmail (PHP)

Quote from: jelv

It may be that as a an anti-spamming measure the script is set to allow Plusnet email addresses only.

I think this is quite common practice. Formmail was a notorious spam trick back in the day.
Townman
Superuser
Superuser
Posts: 17,507
Thanks: 7,312
Fixes: 71
Registered: ‎22-08-2007

Re: Formmail (PHP)

@Barrie,
I have several web pages which use this script, it is not restricted to sending to PN addresses only, it is however restricted to being called from PN hosted web pages only.  You can send the form content to several email addresses as follows - separate addresses with a comma without spaces...
Quote
<form method="post"
action="http://homepages.plus.net/cgi-bin/form">
<input name="recipient"
type="hidden"
value="address1@domainname.org.uk,address2@domainname.org.uk">

It can also be useful to send a copy of the form content to the form filler, you can do this by adding a comma and their email address to the "recipient" field when the form is submitted...
First set an "onsubmit" event on the form
Quote
<form
name="coursebooking"
method="post"
onsubmit="return(checkform());"
action="http://homepages.plus.net/cgi-bin/form">
... rest of form HTML
<input name="send"
type="submit"
value="Send booking request"
tabindex="14">
</form>

Second write the script for handling the event somewhere in your HTML page
Quote
<script language="JavaScript">
function checkform() {
//
// You could put code in here to check that all of the fields have been filled in correctly
//
coursebooking.send.disabled = true
coursebooking.recipient.value = coursebooking.recipient.value + ',' +  coursebooking.email.value
return true;
}
</script>

Where "coursebooking" is the name of the form, "send" is the name of the submit button on the form and recipient / email are the standard FORMMAIL field names.
I hope this helps a little.

Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.

BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)

Thanks Jelv, SteveA and Townman
Much appreciated. I'm working through all the options you have provided along with Force9 so hopefully I can sort out a resolution using your information.
Have a good Christmas.
Regards
Barrie
Townman
Superuser
Superuser
Posts: 17,507
Thanks: 7,312
Fixes: 71
Registered: ‎22-08-2007

Re: Formmail (PHP)

Quote from: townman
I have several web pages which use this script, it is not restricted to sending to PN addresses only, it is however restricted to being called from PN hosted web pages only.

Barrie,
In looking to help someone else with problems with formmail, I've discovered that it looks as though the behaviour of this script has been modified such that it can only send to PN / Force9 (etc) hosted email domain names.  See this thread.
Regards,
Kevin

Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.

Townman
Superuser
Superuser
Posts: 17,507
Thanks: 7,312
Fixes: 71
Registered: ‎22-08-2007

Re: Formmail (PHP)

Note that there are errors on the cgi-script page see this thread.

Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.

BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)

Hello Townman
I thought the original problem had been sorted but it hadn't. Your additional information looks useful, thanks for that....
Apparently, the submitted information at the webpage end is transfered to the host but it isn't getting any further.
Your response looks as if its in the right area....tho' as I said, I'm not a technical person.
Have a good weekend.
Regards
Barrie
BarrieF
Newbie
Posts: 9
Registered: ‎07-12-2009

Re: Formmail (PHP)

Hello Townman
I'm still having problems, the email is received by the host but is not then passed to my mail box. I don't want to take up too much of your time but the code is found on www.linicconsultants.co.uk/planning_permission.html - with a quick scan can you see anything wrong with the code?
Thanks
Barrie