Solved

Formail.asp in Apache not working

Posted on 2009-07-14
2
483 Views
Last Modified: 2012-06-27
I am trying to move websites from a front page server to our new linux with open suse 11 and plesk 9.2.1.  I am aware that the plesk does not support front page extensions.  However when I move lets say a basic site that only true front page comes out is like contact us forms.  So I have deleted the front page code and made a simple formail.asp.  Our server has apache asp installed so I am not sure why this is not working but here is the code below and also the error messages with my form from the plesk server...

[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before Do?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] String found where operator expected at /home/vhosts/xxxxxxxx.xxxx.com/httpdocs/formmail.asp line 21, at end of line <--> (Might be a runaway multi-line '' string starting on line 9) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Do you need to predeclare intact?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] Bareword found where operator expected at /home/vhosts/xxxxxxxxx.xxxxxx.com/httpdocs/formmail.asp line 21, near "cdoSendUsingPort" <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before cdoSendUsingPort?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] Bareword found where operator expected at /home/vhosts/xxxxxxxx.xxxxxxx.com/httpdocs/formmail.asp line 37, near ") <--> <--> <--> CB" <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before CB?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] Bareword found where operator expected at /home/vhosts/xxxxxxxxxx.xxxxxx.com/httpdocs/formmail.asp line 43, near "0 then" <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before then?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] String found where operator expected at /home/vhosts/xxxxxxx.xxxxxx.com/httpdocs/formmail.asp line 79, at end of line <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before ?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [error] error compiling formmail.asp: Can't find string terminator "'" anywhere before EOF at /home/vhosts/xxxxxxx.xxxxxxx.com/httpdocs/formmail.asp line 79. <--> , /usr/lib/perl5/vendor_perl/5.10.0/Apache/ASP.pm line 1468

<%@ LANGUAGE="VBSCRIPT" %>
 
<%
 
'Created by XXXXX
 
'Do Not Use this script without the comments intact
 
'There should be no reason to edit this script
 
 
 
sch = "http://schemas.microsoft.com/cdo/configuration/"
 
Set cdoConfig = CreateObject("CDO.Configuration")
 
 
 
With cdoConfig.Fields
 
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
 
    .Item(sch & "smtpserver") = "XXX.XXX.XXX.XXX"
 
    .update
 
End With
 
 
 
Set cdoMessage = CreateObject("CDO.Message")
 
 
 
 
 
CB = ""
 
 
 
for each whatever in request.form
 
    if instr(lcase(whatever), "x_") = 0 then
 
        CB = CB & whatever & ":" & vbcrlf
 
        CB = CB & request.form(whatever) & vbcrlf & vbcrlf
 
    end if
 
next
 
 
 
With cdoMessage
 
    Set .Configuration = cdoConfig
 
    .From = request.form("Email")
 
    .To = "XXX@XXXX.com"
 
    .Subject = "Contact from "
 
    .TextBody = CB
 
    .Send
 
End With
 
 
 
Set cdoMessage = Nothing
 
Set cdoConfig = Nothing
 
 
 
'redirect to specified URL
 
response.redirect "default.htm"
 
%>

Open in new window

0
Comment
Question by:cstallings
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
Koma666 earned 500 total points
ID: 24877667
Try to change from
With cdoConfig.Fields
 
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
 
    .Item(sch & "smtpserver") = "XXX.XXX.XXX.XXX"
 
    .update
 
End With

to

cdoConfig.Fields.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
cdoConfig.Fields..Item(sch & "smtpserver") = "XXX.XXX.XXX.XXX"
cdoConfig.Fields..update

If the Error messages for line 21 are gone after that I would say that your Apache ASP does not know how to handle the with block. Then you need to change the with blocks to direct definitions.

Another suggestion is that there is something wrong with your tabs or blank spaces, try to delete the blank lines and the tabs and reformat your code.

0
 
LVL 5

Expert Comment

by:Koma666
ID: 24877684
Oh, and it looks like the Apache ASP can not handle your comments, try to remove all comments would also be a good test.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to count occurrences of each item in an array.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question