CDOSYS (CDO for Windows 2000)
Here's a code block for sending out an e-mail using CDOSYS.
' create the e-mail
set o_msg = createobject("cdo.message")
set o_conf = createobject("cdo.configuration")
With o_conf.Fields
.Item("http://schemas.microsoft.com
/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com
/cdo/configuration/smtpserver") = mailserver
.Update
End With
With o_msg
set .Configuration = o_conf
.AutoGenerateTextBody = true
.Fields("urn:schemas:httpmail:importance").Value = 2
.Fields.Update()
.To = emfaddress
.From = emfemailfrom
.Subject = emfemailsubject
.HTMLBody = msg
.AddAttachment "C:\files\a.doc"
.Send
End With
set o_msg = nothing
set o_conf = nothing
Notes
One of the things I find interesting is that some fields need to be set in the configuration object and others need to be set in the message object. It's certainly not clear as to which should be set where.
For setting importance, 2 = important, 1 = normal, and 0 = low.
Conversation
FYI: If you're running your App on an MS Exchange server and you want to use CDOSYS to send mail, you will need to change the IIS settings for that specific web site to run under the ExchangeApplicationPool. Otherwise you will get an "Access denied" error (like I did) and nothing you will try will fix it.
does this relate to using exchange as the cdo delivery mechanism. ie. sendusing = 1 and smtppickupaddress = exchanges one ?
By using the pickup folder (sendusing = 1), you're still using the SMTP protocol, even if it's the SMTP server that comes with Exchange. To send e-mail as a specific user on your exchange server, you'll want to look into CDO (not CDOSYS or CDONTS).
I hope that answers your question. :)
test