HTTP 507 error when emailing form

Hi,

I've created a form in ASP that when the user hits submit the data is gathered and emailed. I've created an asp page that processes the form, formats it with html and sends it on its way. The problem is, it'll work in IIS but not on a Linux server using ChilliASP.

I've found out where it's failing. The code is as follows:

1.function processData()

2

3'Build an array of form field names ordered as they were received.

4str =""

5for i = 1 to Request.form.Count

6for each name in Request.form

7if Left(name, 1) <>"_" and Request.form(name) is Request.form

8(i) then

9if str <>"" then

10 str = str &","

11endif

12str = str & name

13exitfor

14endif

15next

16next

17

18FormFieldList = Split(str,",")

19

20'Build table of form fields and values.

21body ="<table width=""100%"" align=""center"" border=""0""

22cellpadding=""8"" cellspacing=""1"" bgcolor=""#FFFFFF""

23class=""type"">" & vbCrLf

24body = body +"<tr><td colspan=2>Contact Name</td></tr>"

25for i = lbound(FormFieldList) to ubound(FormFieldList)

26

27if instr(ucase(FormFieldList(i)),"COAPPLICANT")= 0 then

28

29body = body +"<tr><td width='50%'

30bgcolor=""#FFFFFF"">"&FormFieldList(i)&"</td>"

31body = body +"<td width='50%' bgcolor=""#FFFFFF"">"&

32Request.form(FormFieldList(i)) &"</td>"

33body = body +"</tr>"' & vbCrLf

34Endif

35next

36body = body &"</table>" & vbCrLf

37processdata = body

38End Function

Everything works fine up until line 32. If I comment out this line the form is emailed (but without the data that was entered in).

If I uncomment out line 32 I get an HTTP 507 error. If I put Request.form(""), it's fine. If I assign FormFieldList(i) to a variable then use the variable in the Request.form method it does not work. I just don't understand what the problem is.

The server is Sun One Apache and apparently ChiliASP is installed on the machine.

[3511 byte] By [rsford35a] at [2007-11-27 5:44:03]
# 1

Hi,

Based on what you say I can only see two reasons.

Some sort of size issue with Body or an issue with the value of the form field.

507 is usually a bug in asp my experience.

I'd suggest you run the code a number of times limiting the form values output so you can determine which one it is that's causing the issue.

Something like

Response.Write Request.form(FormFieldList(i))

body = body + "<td width='50%' bgcolor=""#FFFFFF"">"

if i < 1 then

body = body & Request.form(FormFieldList(i))

end if

body = body &"</td>"

Increment i each time until it fails. The Response.Write will output every value so you should see what value is causing the problem. May then be able to work round it.

Duncan

Duncan_Berrimana at 2007-7-12 15:24:22 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Hi,

Thanks for the tip and for responding so quickly.

I did as you suggested. I inserted your recommended code after line 26 and commented the rest and I still get the error message. If I remove Request.form and just write out FormFieldList(i) it writes the field names out to the page. As soon as I add the Request.form I get the error.

So, I thought perhaps it's the first field that's an issue so I changed it to Response.write Request.form (FormFieldList(0)) and it calved on me. That value would be from a drop down list box.

I then changed the 0 to a 1 and it still calved. This would have been from a text box.

If I randomly put numbers in the array (there are 92 elements) it still fails.

If you have any other suggestions, then I'm all ears because this is crazy!

rsford35a at 2007-7-12 15:24:22 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

> Hi,

> Thanks for the tip and for responding so quickly.

> I did as you suggested. I inserted your recommended

> code after line 26 and commented the rest and I still

> get the error message. If I remove Request.form and

> just write out FormFieldList(i) it writes the field

> names out to the page. As soon as I add the

> Request.form I get the error.

> So, I thought perhaps it's the first field that's an

> issue so I changed it to Response.write Request.form

> (FormFieldList(0)) and it calved on me. That value

> would be from a drop down list box.

>

> I then changed the 0 to a 1 and it still calved. This

> would have been from a text box.

>

> If I randomly put numbers in the array (there are 92

> elements) it still fails.

>

> If you have any other suggestions, then I'm all ears

> because this is crazy!

Just a note. I did a response.write Request.form("field_name") and added it to line 2. And it worked.

However, when I moved it to line 17, I got the server error.

If I changed the code from response.write Request.form("field_name") to response.write Request.form, it would print to the screen. What is it about requesting a form field at that particular point that is making the application die?

If there are any suggestions, please let me know. Thanks!

rsford35a at 2007-7-12 15:24:22 > top of Java-index,Web & Directory Servers,Web Servers...