Having troubles with this page its supposed to display a form and then collect that form data and compose and send email containing that data.
The page will not display, the page uses the following code
<% @LANGUAGE =VBScript %>
<%
Option Explicit
Response.Buffer
Dim strEmail, strSubject, strMessage, objMail, strSql, objConn, strConnection
Dim objRS, strCMail, strSPMail
strCMail = Trim(Request("cmail"))
if (Request.ServerVariables("message") = " ") Then
%>
<html>
<head>
<title>Send Mail To Customer</title>
<link rel="stylesheet" type="text/css" href="mainstyle.css">
</head>
<body bgcolor ="blue">
<center>
<br>
<img bgcolor ="blue" border ="0" height ="150" width ="700" src ="images/title.bmp">
<br>
<br>
<hr>
<br>
<H3>Please use the form below to send an email to this projects customer</H3>
</center>
<br>
<br>
<form action ="mailcustomer.asp" method ="post">
Subject : <input name ="subject" type ="Text" size ="40"><br><br>
Message : <textarea name ="message" rows ="10" cols="65">
Please input your message here
</textarea>
<br>
<input type ="Submit" value ="Send Mail">
</form>
<br>
<address>
Copyright Smith Information Solutions 2004
</address>
</body>
</html>
<%
Else
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection ="DSN=allocation;Database=allocation;"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.Recordset")
strSql ="select ContactEmail from ServiceProvider"
objRS.Open strSql, objConn
strSPMail = objRS("ContactEmail")
objRS.Close
strSubject = Trim(Request.Form("subject"))
strMessage = Trim(Request.Form("message"))
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = strSPMail 'set mail sender address to that input by user
objMail.To = strCMail
objMail.Subject = strSubject 'set subject to subject input by user
objMail.Body = strMessage 'set message to that input by user
objMail.Send
When opening the page the following error message is displayed.
Server object, ASP 0177 (0x800401F3)
Invalid class string
/mailcustomer.asp, line 69
any help would be very useful
Cheers
The page will not display, the page uses the following code
<% @LANGUAGE =VBScript %>
<%
Option Explicit
Response.Buffer
Dim strEmail, strSubject, strMessage, objMail, strSql, objConn, strConnection
Dim objRS, strCMail, strSPMail
strCMail = Trim(Request("cmail"))
if (Request.ServerVariables("message") = " ") Then
%>
<html>
<head>
<title>Send Mail To Customer</title>
<link rel="stylesheet" type="text/css" href="mainstyle.css">
</head>
<body bgcolor ="blue">
<center>
<br>
<img bgcolor ="blue" border ="0" height ="150" width ="700" src ="images/title.bmp">
<br>
<br>
<hr>
<br>
<H3>Please use the form below to send an email to this projects customer</H3>
</center>
<br>
<br>
<form action ="mailcustomer.asp" method ="post">
Subject : <input name ="subject" type ="Text" size ="40"><br><br>
Message : <textarea name ="message" rows ="10" cols="65">
Please input your message here
</textarea>
<br>
<input type ="Submit" value ="Send Mail">
</form>
<br>
<address>
Copyright Smith Information Solutions 2004
</address>
</body>
</html>
<%
Else
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection ="DSN=allocation;Database=allocation;"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.Recordset")
strSql ="select ContactEmail from ServiceProvider"
objRS.Open strSql, objConn
strSPMail = objRS("ContactEmail")
objRS.Close
strSubject = Trim(Request.Form("subject"))
strMessage = Trim(Request.Form("message"))
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = strSPMail 'set mail sender address to that input by user
objMail.To = strCMail
objMail.Subject = strSubject 'set subject to subject input by user
objMail.Body = strMessage 'set message to that input by user
objMail.Send
When opening the page the following error message is displayed.
Server object, ASP 0177 (0x800401F3)
Invalid class string
/mailcustomer.asp, line 69
any help would be very useful
Cheers