help for asp

Status
Not open for further replies.

Anjali

Broken In
hi im useing windows xp
but xp and win 2003 server does not support collaboration Data objects for windows NT server (CDONTS)
is any way that i can use CDONTS on xp

and how i can use following code on windows xp and windows 2003 server

please tell me where i can modify for
windows xp - CDOSYS
windows 2003 server - CDO
in code

<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">

</HEAD>
<BODY>

<HTML>
<HEAD>
<TITLE>Feedback</TITLE>
</HEAD>

<BODY bgCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" vLINK="#0000AA" aLINK="#000000">

<%

' The location of the text file containing the data for
' the auto-response message.
Filename = "<please insert the path>\auto_response.txt"

' This script checks for information in required
' form variables, trims the spaces from the information
' that was entered, sends the feedback message,
' and sends the visitor an auto-response message
' that is read from a text file.


' Retrieve the information the user entered and
' store it in variables.
reqName = Trim(Request.Form("Name"))
reqEMail = Trim(Request.Form("EMail"))
reqMessage = Trim(Request.Form("Message"))


' Check for required information and provide
' the visitor with an error message if a required
' field was left blank.
If reqName = "" OR reqEMail = "" OR reqMessage = "" Then
' Not all required information was
' entered. Provide the visitor with an error
' message
%>
<font color="#FF0000">
Error!</font>



You must enter information for all of the required
fields.
<%
Else
' Sufficient information was entered.
'
' Proceed.


' Provide ASPEMail with the information it needs
' to send the feedback message.
Set oMail = Server.CreateObject("CDONTS.newmail")
'oMail.ishtml= False
'oMail.Host = "www.yourdomain.com"
'oMail.FromName = reqName
oMail.From = reqEMail
oMail.To = "yourmail@isp.com"
oMail.Subject = "Feedback"
oMail.Body = "This feedback message was sent from your website:" & VBCrLf & VBCrLf & reqMessage

' Send the feedback now & check for
' errors.
On Error Resume Next
oMail.Send()
If Err = 0 Then
' The email was successfully sent.
' Show the visitor a thank you message.
%>
Thank you!



Your feedback has been sent.
<%
Else
' The email was not sent. Show the
' visitor an error message.
%>
Error!



An error occured while sending your feedback. Please try again later.
<%
End If


' We are now ready to send the auto-response
' message. In order to do so, we must first retrieve
' the information that will be used in the auto-response
' message from a text file. Once we have done so we will
' send the email message.

' Check if the file exists. If the file exists we
' will continue, otherwise we will simply end the program
' here and not bother sending an auto-response message.
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If oFS.FileExists(Filename) Then
' The file exists. Retrieve the information
' from it.
Set oTS = oFS.OpenTextFile(Filename)
FromName = oTS.ReadLine
FromAddress = oTS.ReadLine
Subject = oTS.ReadLine
While NOT oTS.AtEndOfStream
Message = Message & VBCrLf & oTS.ReadLine
Wend
oTS.Close
Set oTS = Nothing

' Send the auto-response message.
'oMail.FromName = FromName
oMail.From = FromAddress
oMail.Subject = Subject
oMail.To = reqEMail
oMail.Body = Message
oMail.Send()
End If
Set oFS = Nothing

' Free the memory used by the email
' component.
Set oMail = Nothing
End If
%>

</BODY>
</HTML>



</BODY>
</HTML>
 

#/bin/sh

Journeyman
NOt sure about your code but you can use CDO like this:
Code below works, I use it: uses port 25, no configuration. Had problem with configuration on local machine.

strTo = Request.Form("Email") 'Make sure the From field has no spaces.
strFrom = "youremail@yourdomain.com"
strSubject = "Your Subject"
strBody = "The content of email"


' Create an instance of the NewMail object.
Set objCDOMail = Server.CreateObject("CDO.Message")

' Set the properties of the object
objCDOMail.Sender = StrFrom
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.TextBody = strBody


' Some of the more useful ones I've included samples of here:
'objCDOMail.Cc = "mailto:a@abc.com;b@abc.com" Notice this sending to more than one person!
'objCDOMail.Bcc = "c@abc.com;d@abc.com"
'objCDOMail.Importance = 1

'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt"

' Send the message!
objCDOMail.Send

' Set the object to nothing because it immediately becomes
' invalid after calling the Send method + it clears it out of the Server's Memory.
Set objCDOMail = Nothing
 

#/bin/sh

Journeyman
OR u can used ur same code
You can copy the CDONTS dll onto the server and register it using regsvr32 and it should work
Use your existing CDONTS page and copy the cdonts.dll from a windows 2000 machine into c:\Windows\System32.
Then you click Start then Run and put in
and registered as
start ->
run -> command as follows*

regsvr32
%:\windows\system32\cdonts.dll

where
- % = check the drive.
then you can
able to use CDONTS on winxp and win3k.
 
Status
Not open for further replies.
Top Bottom