| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
||||
|
||||
|
__________________
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 |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > emails with .asp - converting CDONTs to CDOs - HELP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|