Solved

Formail.asp in Apache not working

Posted on 2009-07-14
2
478 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now