navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Changing From ASP to CDONTS

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Changing From ASP to CDONTS
Page: [1]
 
Brad

 

Posts: 70
From: Ogden, UT, USA
Status: offline

 
Changing From ASP to CDONTS - 7/1/2003 16:32:08   
Dangit!!! I switched my web host and the new host (Microsoft' s bCentral) does not support ASP mail. I had lots of little scripts and now they don' t work. IS this what I should be looking for....

Set Mailer = Server.CreateObject (" SMTPsvg.Mailer" )

and change the SMTPsvg.Mailer to

Set Mailer = CreateObject(" CDONTS.NewMail" )

or something like that? There is also sometimes SetMailer1 and SetMailer2
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Changing From ASP to CDONTS - 7/1/2003 16:47:32   
Thats the mail code, yes :)
However, there are a few different formats as you see below. That will need changing too.


ASPMail
oMail.RemoteHost = strServer
oMail.AddRecipient strTo, strTo
oMail.FromName = strFrom
oMail.FromAddress = strFrom
oMail.Subject = strSubject
oMail.BodyText = strBody
oMail.SendMail

CDONTS
oMail.To = strTo
oMail.BodyFormat = 1
oMail.MailFormat = 0
oMail.From = strFrom
oMail.Subject = strSubject
oMail.Body = strBody
oMail.Send

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Brad)
Brad

 

Posts: 70
From: Ogden, UT, USA
Status: offline

 
RE: Changing From ASP to CDONTS - 7/1/2003 16:57:34   
Does it make any difference what the name of the Mailer is? Like in your example you have " oMailer" on my site it' s just Mailer or Mailer1 or Mailer2.

Also I have seen objMail and others...any difference?

(in reply to Brad)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Changing From ASP to CDONTS - 7/1/2003 17:02:35   
Yes, it does matter what its called, but only on your page.
You must use the same object name in each script
eg :

Set Mailer = Server.CreateObject (" SMTPsvg.Mailer" )
Mailer.RemoteHost = strServer
Mailer.AddRecipient strTo, strTo
Mailer.FromName = strFrom

Set ThisMail = Server.CreateObject (" SMTPsvg.Mailer" )
ThisMail.RemoteHost = strServer
ThisMail.AddRecipient strTo, strTo
ThisMail.FromName = strFrom

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Brad)
Brad

 

Posts: 70
From: Ogden, UT, USA
Status: offline

 
RE: Changing From ASP to CDONTS - 7/1/2003 17:31:20   
Okay...awesome. So, if my page is currently this:


-----------------------------------------------------------------------------------------------------

Set rsPass = dbquery(passRet,con)
if not rsPass.eof then
Password = rsPass(0)
Email = rsPass(1)
FromName = " Administrator"
FromEmail = Application(" AdminEmail" )
Subject = " Your Password."
BodyText = " Dear " &FirstName&" " &LastName&" ," &vbcrlf&vbcrlf&" your password is " &Password&" ." &vbcrlf&" Thankyou for using our services " &vbcrlf&vbcrlf&" Regards," &vbcrlf&" Administrator."
Set Mailer = Server.CreateObject (" SMTPsvg.Mailer" )
Mailer.FromName = FromName
Mailer.FromAddress = FromEmail
Mailer.Subject = Subject
Mailer.BodyText = BodyText
Mailer.RemoteHost = " mail-fwd.boca15-verio.com"
Mailer.AddRecipient FirstName&" " &LastName , Email
if Mailer.SendMail then
mailSent = True
else
' Message send failure
mailSent = False
end if
Set Mailer = Nothing


------------------------------------------------------------------------------------------------------


And I want it to go CDONTS I would make it:


-----------------------------------------------------------------------------------------------------

Set rsPass = dbquery(passRet,con)
if not rsPass.eof then
Password = rsPass(0)
Email = rsPass(1)
FromName = " Administrator"
FromEmail = Application(" AdminEmail" )
Subject = " Your Password."
BodyText = " Dear " &FirstName&" " &LastName&" ," &vbcrlf&vbcrlf&" your password is " &Password&" ." &vbcrlf&" Thankyou for using our services " &vbcrlf&vbcrlf&" Regards," &vbcrlf&" Administrator."
Set Mailer = CreateObject(" CDONTS.NewMail" )

Mailer.From = FromName
Mailer.MailFormat = 0 Mailer.Subject = Subject
Mailer.Body = BodyText

Mailer.To FirstName&" " &LastName , Email
if Mailer.Send then
mailSent = True
else
' Message send failure
mailSent = False
end if
Set Mailer = Nothing

(in reply to Brad)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Changing From ASP to CDONTS - 7/1/2003 17:34:40   
Like so :
Set Mailer = CreateObject(" CDONTS.NewMail" ) 
Mailer.From = FromName
Mailer.BodyFormat = 1 
Mailer.MailFormat = 0 
Mailer.Subject = Subject 
Mailer.Body = BodyText 
Mailer.To = Email 
Mailer.Send
Set Mailer = Nothing 

There isnt any error handling in CDO, so theres no need for the if/then stuff.

< Message edited by Spooky -- 7/1/2003 5:35:06 PM >


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Brad)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Changing From ASP to CDONTS
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts