PDA

View Full Version : Small formmail problem


Steph
03-10-2003, 07:29 PM
Hi, I've been staring at these two forms and can't figure out what the problem is. I'm just testing them for a client - one is at www.unicorndesigns.ca/contact1.html the other is www.unicorndesigns.ca/credit_app.html

They both send the results to me okay but for some reason when I receive the e-mail for the contact1.html form it comes back showing the e-mail being sent by & nbsp; instead of a proper e-mail address showing. I'm thinking I've missed a closing bracket somewhere in my form or something but can't seem to find it. Anyone got any ideas? I appreciate the help, thanks Steph:)

don5408
03-11-2003, 08:04 AM
"for some reason when I receive the e-mail for the contact1.html form it comes back showing the e-mail being sent by & nbsp; instead of a proper e-mail address showing."

Hi, Steph. Are you talking about the "e-mail" value within your form output in the body of the email or are you talking about the return address shown for the email in the headers/From: line?

I tested your contact1.html file as is changing only the recipient value and recieved the following emailed output:

----------------------------------
From: www@host32.hrwebservices.net
To: don@mydomain.com
Date: 3/11/03 6:45:00 AM
Subject: Rate Request
----------------------------------

city: AnyTown
company: DonCom
country: USA
destination: LA
dimensions: Inches
e-mail: me@whatever.com
fax: 0000000000
frequency: daily
lbs: ON
name: John Doe
origin: NYC
other+info: need insurance
phone: 0000000000
product: goobles, widgets and biggleball valves
province%2fstate: NY
redirect: http://www.unicorndesigns.ca/response2.html
street+address: 123 Main St
transport+by: dog sled
weight: 10
----------------------------------

The "e-mail" value in the message body of the email came through exactly as entered. Is that where the problem is when you test the email, or...?

Don

Steph
03-11-2003, 12:48 PM
Hi Don
I'm actually talking about the "From"line in the header. When I just open my "In Box" the "From" line says "& nbsp;" (of course with no space between the & and n). When I actally open the mail I get the following: (No From Name, just ())
Subject: WWW Form Submission
From: ()
Date: Tue, March 11, 2003 11:16 am
To: sdinnell@unicorndesigns.ca
Subject: Rate Request
Company: ABC Company
Street Address: any Street
City: Any City
Province/State: BC
Country: Canada
Phone: 604 xxx-xxxx
Fax: 604 xxx-xxxx
Name: Me
Title: Boss
E-mail: me@abc.com
Product: Stuff
Origin: Vancouver
Destination: Seattle
Weight: 100
lbs: ON
Dimensions: 50 x 50, Inches
Transport By: Truck
Frequency: once
Other Info: No insurance required
This message does show at the top of the e-mail when I open it, don't understand it:
Warning: Invalid argument supplied for foreach() in /usr/local/squirrelmail/src/read_body.php on line 620




When I do the Credit_app form, if I fill in the e-mail address in the form, the address will show in the "From" part of the header but not in the message body of the form - don't understand why. This is what I get:
Subject: WWW Form Submission
From: me@abc.com ()
Date: Tue, March 11, 2003 11:19 am
To: sdinnell@unicorndesigns.ca
Subject: Credit Application
company: ABC Company
billing_address_1: any Street
city: Any City
state: BC
zip_code: 10095
country: USA
phone: xxx-xxxx
fax: xxx-xxxx
attention_of: me
business_type: corporation
federal_tax_id_no: 1000111
bank_name: xxx
branch: xxx
account_no: xxx
bank_phone: xx
account_officer: xxx
reference_business_name_1: xxx
reference_telephone_1: xx
reference_account_no_1: xxx
person_requesting_credit: mE
signature_date: 3/11/03

When I do the Credit_app form, if I don't fill in the e-mail address in the form, the address doesn't show in the "From" part of the header ,only the & nbsp; when I just open my In-box, and nothing in the message body of the form. This is what I get:
Subject: WWW Form Submission
From: ()
Date: Tue, March 11, 2003 11:20 am
To: sdinnell@unicorndesigns.ca
Subject: Credit Application
company: ABC Company2
billing_address_1: any Street
city: Any City
state: BC
zip_code: 10095
country: USA
phone: xxx-xxxx
fax: xxx-xxxx
attention_of: me
business_type: corporation
federal_tax_id_no: 1000111
bank_name: xxx
branch: xxx
account_no: xxx
bank_phone: xx
account_officer: xxx
reference_business_name_1: xxx
reference_telephone_1: xx
reference_account_no_1: xxx
person_requesting_credit: mE
signature_date: 3/11/03
I also get the same message at the top of the e-mail: Warning: Invalid argument supplied for foreach() in /usr/local/squirrelmail/src/read_body.php on line 620

Sorry this is so long. This is really driving me crazy, lol. Thanks for any help.

don5408
03-11-2003, 01:23 PM
"I'm actually talking about the "From"line in the header."

OK, gotcha...if you want the user's email added to the From: line as a return address (rather than as a value in the body of the email) just use a field named "email" as opposed to "E-mail".

Change this:
<INPUT TYPE="text" NAME="E-mail" size=20>

to this:
<INPUT TYPE="text" NAME="email" size=20>

If you also want the user's name to appear in the From: field as in
From: theuser@abc.com (John Doe) use "realname" instead of "Name"

Change this:
<INPUT TYPE="text" NAME="Name" size=20>

to this:
<INPUT TYPE="text" NAME="realname" size=20>

Note that details on the "email", "realname" and other supported FormMail values are all documented in the FormMail ReadMe which can be found under "Form Mail" in the HR Control Panel.

"When I do the Credit_app form, if I fill in the e-mail address in the form, the address will show in the "From" part of the header but not in the message body of the form - don't understand why."

This is normal behavior. In credit_app.html you have your email field named "email" so by design the email address will be inserted in the From: line rather than as form output in the body of the email. The same applies to the "realname" field, if you use that the user (or company) name will be inserted into the From: line rather than in the message body.

"Warning: Invalid argument supplied for foreach() in /usr/local/squirrelmail/src/read_body.php on line 620"

That error would seem to be specific to the SquirrelMail webmail client. I'm not sure what it's in reference to however under the circumstances it may have something to do with the empty name field. If you are only getting this with your emailed form output and not with any other mail you might want to just try changing your form to include realname and email fields, it's not impossible that this alone might get rid of the error.

Hope that helps!
Don

Steph
03-11-2003, 01:32 PM
Thanks so much Don, I'll try that out! Appreciate all your help.
Steph

Brendan
12-29-2003, 10:57 PM
.