[python-win32] Using CDO via COM
Bob Gailer
bgailer at alum.rpi.edu
Mon May 3 16:09:50 EDT 2004
At
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_clb_sending_smtp_mail_by_port_25_using_cdosys_vb.asp
there is sample VBA code for using CDOSYS to send mail. Here is the start
of the code:
**** CODE****
'Sending SMTP mail via port 25 using CDOSYS
'This VB sample uses CDOSYS to send SMTP mail using the cdoSendUsingPort
option and specifying a SMTP host.
Private Sub SendMessage(strTo As String, strFrom As String)
'Send using the Port on a SMTP server
Dim iMsg As New CDO.Message
Dim iConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Dim strHTML
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smarthost"
'Use SSL to connect to the SMTP server:
'.Item(cdoSMTPUseSSL) = True
.Item(cdoSMTPConnectionTimeout) = 10
.Update
End With
[snip]
I can use win32com.client'Dispatch to get CDO.Message and CDO.Configuration
I don't understand what to do with Dim Flds As ADODB.Fields, and how to get
the (I assume constants) cdoSendUsingMethod etc.
Any guidance will be appreciated.
Bob Gailer
bgailer at alum.rpi.edu
303 442 2625 home
720 938 2625 cell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20040503/dde85c79/attachment.html
More information about the Python-win32
mailing list