0
votes

I am new for classic asp. I have written simple code to send mail using classic asp as follows :

HTML Code:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form method="post" action="ASPformEmailResults.asp">
<p><input type="submit" name="submit" value="Submit"/></p>
</form>
</body>
</html>

ASP page:

   <%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black"> 
</body>
</html>

but whenever open html page & click on submit button then mail should sent to given id but it displays asp page content. Please help me to solve this problem.

Thank You.

1
Obvious question, are you running this through IIS? Does any other ASP code run?Adrian Wragg
I tried with IIS, but it displays asp content file onlyIshita
Have you allowed asp code to run in the IIS installation? A quick test would be to have one .asp page with <% =("Hello World") %>Tim B James

1 Answers

2
votes

Based on the information given, it appears that although IIS is installed, the ASP parser itself is either disabled or unmapped.

The following instructions will enable it for Windows 8; other versions of Windows will be similar:

  • From the Start screen, search for "Turn Windows features on or off"; it will be under 'Settings'.
  • Expand 'Internet Information Services'
  • Expand 'World Wide Web Services'
  • Expand 'Application Development Features'.
  • Tick 'ASP'.

Click 'OK', and ASP will be enabled within IIS.

If it is installed, it may well be disabled. Load up the IIS Manager (either through the start screen, or by running inetmgr directly from Start, Run, then:

  • Expand your computer name
  • Expand 'Sites'
  • Click on 'Default Web Site'.
  • Click on 'Handler Mappings'.

Ensure that the mapping ASPClassic is enabled for *.asp; if it isn't, you will need to create it and ensure that its executable is set to %windir%\system32\inetsrv\asp.dll.