Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 13th, 2004, 03:25 PM
Andrew Fisher Andrew Fisher is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 Andrew Fisher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy emails with .asp - converting CDONTS to CDOSYS - HELP

I have inherited an e-commerce website which generates two automatic confirmation emails. The site was written using CDONTS and I have to move the site to a new host which uses CDO. I was given sample code from our new hosting company but am having trouble converting it and getting it to work. Need help, please.

Here is the old CDONTS code from the dbutils.asp file. What do I need to change?

<%

Function SendCDOEmail(strSubject, strBody,strFromAddress,strToAddress)
Const CdoBodyFormatText = 1
Const CdoBodyFormatHTML = 0
Const CdoMailFormatMime = 0
Const CdoMailFormatText = 1
Dim Message 'As New cdonts.NewMail

'Create CDO message object
Set Message = server.CreateObject("CDONTS.NewMail")
With Message

'Set email adress, subject And body
.To = strToAddress
.Subject = strSubject
.Body = strBody
.from = strFromAddress

'set mail And body format
.MailFormat = 0 'CdoMailFormatText
.BodyFormat = 0'strBodyFormat

'Send the message
.Send
End With
set message = nothing
end function

Function SendCDOEmailOLD(smtpserver, strSubject, strBody, strFromAddress,strToAddress,strCc, intpriority, strBodyFormat)

'Const CdoBodyFormatText = 1
'Const CdoBodyFormatHTML = 0
'Const CdoMailFormatMime = 0
'Const CdoMailFormatText = 1
'Dim Message 'As New cdonts.NewMail

'Create CDO message object
'Set Message = server.CreateObject("CDONTS.NewMail")
'With Message

'Set email adress, subject And body
'.To = strToAddress
'.Subject = strSubject
'.Body = strBody
'.from = strFromAddress

'set mail And body format
'.MailFormat = CdoMailFormatText
'.BodyFormat = strBodyFormat

'Send the message
'.Send
'End With
'set message = nothing

theSchema="http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig=server.CreateObject("CDO.Configuration")

cdoConfig.Fields.Item(theSchema & "sendusing")= 2
cdoConfig.Fields.Item(theSchema & "smtpserver")= "localhost"
cdoConfig.Fields.Update
set cdoMessage=Server.CreateObject("CDO.Message")
cdoMessage.Configuration=cdoConfig

cdoMessage.From=strFromAddress
cdoMessage.To=strToAddress
cdoMessage.Subject= strSubject

cdoMessage.TextBody= strBody

cdoMessage.Send
Set cdoMessage=Nothing
Set cdoConfig=Nothing

End Function
%>



Thanks!

Reply With Quote
  #2  
Old December 13th, 2004, 05:13 PM
freeasphelp's Avatar
freeasphelp freeasphelp is offline
Beyond The Impossible
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Shawnee Mission, KS, USA
Posts: 921 freeasphelp User rank is Corporal (100 - 500 Reputation Level)freeasphelp User rank is Corporal (100 - 500 Reputation Level)freeasphelp User rank is Corporal (100 - 500 Reputation Level)freeasphelp User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 25 m 9 sec
Reputation Power: 7
Try my X-Send function. Please contact me if you have any problems or questions configuring it. It includes a help file I think you will be able to figure it out.
__________________
John Shepard
Beyond The Impossible
-----------------------------
Has a post helped you? Please show your apprecitation by clicking the
image in the right upper corner.
Posting code? Put your code between [code] and [/code] tags.
X-Login and X-Send

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > emails with .asp - converting CDONTs to CDOs - HELP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT