Solved

CDOSYS

Posted on 2004-09-07
13
653 Views
Last Modified: 2012-06-27
How knows where there is exact information on the use of CDOSYS in ASP.  I need to convert all my CDONTS to CDOSYS because of an environement change.
0
Comment
Question by:pinkstonm
  • 5
  • 3
  • 3
  • +1
13 Comments
 
LVL 31

Expert Comment

by:alorentz
ID: 11997945
0
 
LVL 31

Expert Comment

by:alorentz
ID: 11997967
0
 
LVL 12

Expert Comment

by:GoofyDawg
ID: 11998020
Here's a good example of sending an e-mail via CDO on the MSDN site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_clb_sending_a_web_page_by_smtp_mail_using_cdosys_vbs.asp

Here's a link to the CDO library reference:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deoricdobasics.asp

That's the source, though here's a nice example from w3schools.com:

http://www.w3schools.com/asp/asp_send_email.asp

GoofyDawg

0
 

Author Comment

by:pinkstonm
ID: 11998291
I tried using it and I get an error and quickie help?

CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/toolsprocesses/smartreq_write.asp, line 70
It tells me one of the http://scemas is bad?

''*****************************
'' Send CDOSYS Notification
''*****************************
Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message") 'calls CDO message COM object
Dim iConf
Set iConf = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
Dim Flds
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'tells cdo we're using the local smtp service
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "m0551uspln2.clienteds.extad.eds.com"
Flds.Update 'updates CDO's configuration database

iMsg.To = "david.eichler@eds.com, Matt.Pinkston@eds.com"
iMsg.From = temail
iMsg.Subject = "SMART Download Access: requested by: " & request.servervariables("HTTP_CT_REMOTE_USER") & " " & tlname & ", " & tfname
iMsg.TextBody = "Date Opened-" & now & vbnewline & "Contact-"  & tlname & ", " & tfname & vbnewline & "Email-" & temail & vbnewline & "Phone-" & tphone & vbnewline & "Business Case-" & tbc
iMsg.Send
0
 
LVL 31

Expert Comment

by:alorentz
ID: 11998322
Don't mees with the configursation:

 
Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message") 'calls CDO message COM object
iMsg.To = "david.eichler@eds.com, Matt.Pinkston@eds.com"
iMsg.From = temail
iMsg.Subject = "SMART Download Access: requested by: " & request.servervariables("HTTP_CT_REMOTE_USER") & " " & tlname & ", " & tfname
iMsg.TextBody = "Date Opened-" & now & vbnewline & "Contact-"  & tlname & ", " & tfname & vbnewline & "Email-" & temail & vbnewline & "Phone-" & tphone & vbnewline & "Business Case-" & tbc
iMsg.Send
 
 
0
 

Author Comment

by:pinkstonm
ID: 11998574
Still getting

CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

/toolsprocesses/smartreq_write.asp, line 79
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 31

Expert Comment

by:alorentz
ID: 11998599
0
 

Author Comment

by:pinkstonm
ID: 11998704
All I need is a place that has doc saying what I need to specify all parameters.  My CDONTs worked fine but I got moved to a new server and it is no longer supported.
0
 
LVL 31

Expert Comment

by:alorentz
ID: 11998741
We've provided you plenty of documents and links.  Sounds like the problem is you host, and you should contact them...
0
 
LVL 2

Expert Comment

by:pheine
ID: 12004756
strage, but... if you tell CDOSYS sendusing = 1 (local smtp) why set the SMTPServer to "m0551uspln2.clienteds.extad.eds.com"?

should be localhost or 127.0.0.1 if you need to set it at last?
0
 
LVL 2

Expert Comment

by:pheine
ID: 12004809
oh, and you have to tell the iMsg Object to use the iConf Object:
"iMsg.Configuration = iConf" or "SET iMsg.Configuration = iConf"
0
 
LVL 12

Accepted Solution

by:
GoofyDawg earned 50 total points
ID: 12008097
This is working code. I nabbed it off of MSDN, and made changes to the values used for my mail server.

<%
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost

Const cdoSendUsingPort = 2
StrSmartHost = "mail.iarchitec.com"

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' set the CDOSYS configuration fields to use port 25 on the SMTP server

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

' build HTML for message body
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & Request("fullname") & "&nbsp;~&nbsp;" & Request("phone") & "<br><br>Comment/Question<br>======================"
strHTML = strHTML & Request("qc")
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"


With iMsg
Set .Configuration = iConf
.To = "goofdawg@company.com"
.From = Request("fullname") & "<" & Request("email") & ">"
.Subject = Request("subject")
.HTMLBody = Request("qc")
.Send
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

%>

I was reading through the CDOSYS documentation on MSDN. It's a little convoluted because MS throws lots of little constants at you whose values you have to dig for, but once you get it, it's pretty straight forward.

GoofyDawg
0
 
LVL 12

Expert Comment

by:GoofyDawg
ID: 12008131
BTW, you don't necessarily need to specify port 25 exactly with CDO. The assumption that's made when setting "sendusing" to 2 (network) is that port 25 will be used automatically, so you needn't specify. You only need to provide the transport method 1 = sendUsingPickupDirectory, 2 = sendUsingNetwork.

GoofyDawg
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Round to 2 decimal places 2 40
Use a variable for Class Name in Classic ASP 4 46
Time/Date Query 11 37
is this a cms? 8 34
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now