Solved

Formail.asp in Apache not working

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

707 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

17 Experts available now in Live!

Get 1:1 Help Now