If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > CDONTS to CDOSYS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-04, 16:36
VJT2 VJT2 is offline
Registered User
 
Join Date: Sep 2003
Posts: 5
Question CDONTS to CDOSYS

My server recently uprgraded to CDOSYS from CDONTS....i need to change this ASP so that it works for CDOSYS......can someone plz help...thanks!


<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim objMail

'//Rename this to the name of your button
If (Request.Form("Submit") <> "") Then

Set objMail = Server.CreateObject("CDONTS.NewMail")

'Collecting form information
email = Request.Form("Email")
name = Request.Form("Name")
phone = Request.Form("Phone")
address = Request.Form("Address")
city = Request.Form("city")
state = Request.Form("state")
zipcode = Request.Form("zip")
comments = Request.Form("Comments")

'Build message body
BodyString = BodyString & "The following response was given via the Pastors' Response Page" & VbCrLf
BodyString = BodyString & "Email: = " & Email & VbCrLf
BodyString = BodyString & "Name: = " & Name & VbCrLf
BodyString = BodyString & "Phone: = " & Phone & VbCrLf
BodyString = BodyString & "Address: = " & Address & VbCrLf
BodyString = BodyString & "City: = " & city & VbCrLf
BodyString = BodyString & "State: = " & state & VbCrLf
BodyString = BodyString & "Zip Code: = " & zip & VbCrLf
BodyString = BodyString & "Comments" & Comments & VbCrLf


objMail.From = email
objMail.Subject = "Pastors' Reply"
objMail.To = "jimmyt@filmthebible.org"
objMail.Body = BodyString
objMail.Send
If Err.Number = 0 Then 'No errors so display the confirmation message
Response.Write "Your Reply was succesfully sent. You will now be taken back to Pastors Golf Tour Home"
Else
Response.Write Err.Number & "<P>"
Response.Write Err.Description & "<P>"
Err.Clear
Set objMail = nothing
End If
End IF
%>
</body>
</html>
Reply With Quote
  #2 (permalink)  
Old 04-01-04, 18:40
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Here are some notes I made about moving from CDONTS to CDO that hopefully might help you too.

CDO is generally used instead of CDONTS on IIS 5 and after (actually the SMTP service within IIS) which is generally on servers after Win NT4 (although I think CDONTS is generally still supported too).

Here are changes I made to convert CDONTS stuff to be CDO stuff instead:

o Change objCDONTS to be called objCDO (actually this is just a cosmetic change)

o This:
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")

Changed to this instead:
Set objCDO = Server.CreateObject("CDO.Message")

o This:
objCDONTS.Body = strEmailBody

Changed to this instead:
objCDO.TextBody = strEmailBody

o This removed:
' Importance.
' (0=Low, 1=Normal, 2=High)
objCDONTS.Importance = 1
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #3 (permalink)  
Old 04-01-04, 20:41
VJT2 VJT2 is offline
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks for the help......

but.....

most of the code lines that you asked me to change were not in my code
Reply With Quote
  #4 (permalink)  
Old 04-01-04, 20:59
VJT2 VJT2 is offline
Registered User
 
Join Date: Sep 2003
Posts: 5
HEHE i lied

Here is my final code with your corrections......i cant test it yet b/c my server has to change the permissions but......



<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim objCDO
'//Rename this to the name of your button

If (Request.Form("Submit") <> "") Then

Set objCDO = Server.CreateObject("CDO.Message")

'Collecting form information
email = Request.Form("Email")
name = Request.Form("Name")
phone = Request.Form("Phone")
address = Request.Form("Address")
city = Request.Form("city")
state = Request.Form("state")
zipcode = Request.Form("zip")
comments = Request.Form("Comments")

'Build message body
strEmailBody = strEmailBody & "The following response was given via the Pastors' Response Page" & VbCrLf
strEmailBody = strEmailBody & "Email: = " & Email & VbCrLf
strEmailBody = strEmailBody & "Name: = " & Name & VbCrLf
strEmailBody = strEmailBody & "Phone: = " & Phone & VbCrLf
strEmailBody = strEmailBody & "Address: = " & Address & VbCrLf
strEmailBody = strEmailBody & "City: = " & city & VbCrLf
strEmailBody = strEmailBody & "State: = " & state & VbCrLf
strEmailBody = strEmailBody & "Zip Code: = " & zip & VbCrLf
strEmailBody = strEmailBody & "Comments" & Comments & VbCrLf


objCDO.From = email
objCDO.Subject = "Pastors' Reply"
objCDO.To = "jimmyt@filmthebible.org"
objCDO.TextBody = strEmailBody
objCDO.Send
If Err.Number = 0 Then 'No errors so display the confirmation message
Response.Write "Your Reply was succesfully sent. You will now be taken back to Pastors Golf Tour Home"
Else
Response.Write Err.Number & "<P>"
Response.Write Err.Description & "<P>"
Err.Clear
Set objCDO = nothing
End If
End IF
%>
</body>
</html>
Reply With Quote
  #5 (permalink)  
Old 04-02-04, 01:01
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Looks like it might just work (hopefully)!
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On