Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2005, 08:22 AM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ansata
Default CDoNTS to CDO

I need a help. I'm uploading a website. it was hosted in NTserver, now the server has changed to 2003. "CDONTS" was the object used to recive mail(Data is received from a form and send as a mail). 2003 does not support CDONTS insted it use CDO. How could i change CDONTS to CDO. I have tried a lot but it is not working. What all things i need to now to get it working. Do i have to know the SMTP/POP3 server or the PORT used to send/recive mail Or any other configuration which i should add to this code other than changing "Set objMail = CreateObject("CDO.Message")".

Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = Request.ServerVariables("SERVER_NAME")
objMail.To = "[email protected]"
objMail.Subject = "Feedback Form Submitted from our website."
objMail.Body = mBody
objMail.importance = cdoHigh
objMail.Send
Set objMail = nothing
%>
 
Old March 2nd, 2005, 02:56 PM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sherief Send a message via Yahoo to sherief
Default

Hi ansata,

If you want to use CDO, first thing you have to know is the setup of SMTP server, first its address and ports, it can be ip (202.155.x.x) or servername (mail.something.com) or if it's in the same machine with webserver, we can just put "localhost". Ports usually use 25.
And next is the authentication, if your SMTP server needs an authentication to send email, your need to create account that you will use to send email and you will have to set the username and password when you want to send it.

here some simple example (using authentication):

Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoAnonymous = 0
Const cdoBasic = 1
Const cdoNTLM = 2
Set objMessage = CreateObject("CDO.Message")
objMessage.From = """Your Name""<[email protected]>"
objMessage.To = "[email protected]"
objMessage.Subject = "An Email From Active Call Center."
objMessage.TextBody = _
"This is some sample message text.." & _
vbCRLF & _
"It was sent using SMTP authentication."

objMessage.AddAttachment("file://C:\Program Files\Active Call Center\Examples\Goodbye.wav")

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = _
cdoSendUsingPort

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.YourServer.com" ' Or "mail.server.com"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = _
cdoBasic

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = _
"[email protected]"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = _
"Password"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = _
25

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = _
False

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = _
60

objMessage.Configuration.Fields.Update

objMessage.Send

Set objMessage = nothing

You can find more about sending email using CDO on http://msdn.microsoft.com/library/en..._messaging.asp

Is it explain enough?

Regards,
Sherief C. Mursyidi
 
Old March 7th, 2005, 09:26 PM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just a little additional information:

I've use the declaration of variables without "Const" and it works really fine.

[]'s

Rogério:)

Best Regards

Rogério Carrasqueira





Similar Threads
Thread Thread Starter Forum Replies Last Post
using CDONTS maunishq ASP.NET 1.0 and 1.1 Basics 1 August 23rd, 2007 09:35 AM
CDO/CDONTS: Receiving mail delivery confirmation antalas Classic ASP Professional 0 February 21st, 2006 03:43 PM
CDONTS preeti Wrox Book Feedback 1 August 11th, 2004 09:39 AM
CDONTS asims12 Classic ASP Basics 1 November 13th, 2003 10:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.