S
SHIPP
I obtained the following code from this site. It doesn't work. Most likely my
fault. I believe it is in the configuration. What do each of the .item fields
mean?
Sub CDOTestFive()
'set the following References from the Menu bar under Tools then References
'Microsoft CDO for Windows 2000 Library
'Microsoft ActiveX Data Objects 2.5 Library
Dim iMsg As CDO.Message
Dim iConf As CDO.Configuration
Dim Flds As ADODB.Fields
Dim strHTML As String
On Error GoTo HandleErr
Set iMsg = New CDO.Message
Set iConf = iMsg.Configuration
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"propexbe.propeople.org"
..Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10
.Update
End With
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b><p>Please let me know if you got an attachment and
if you could open it. Thanks.</p></b></br>"
strHTML = strHTML & "<b><p>Also please let me know if the text of the
message is bold. Thanks. </b></p>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
With iMsg
Set .Configuration = iConf
.To = "(e-mail address removed)"
' .CC = "(e-mail address removed)"
.From = "(e-mail address removed)"
.Subject = "Please read: test CDOSYS message with Attachment13"
.HTMLBody = strHTML
.Send
End With
MsgBox "Mail Sent!"
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
ExitHere:
Exit Sub
HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical,
strProcName
End Select
End Sub
fault. I believe it is in the configuration. What do each of the .item fields
mean?
Sub CDOTestFive()
'set the following References from the Menu bar under Tools then References
'Microsoft CDO for Windows 2000 Library
'Microsoft ActiveX Data Objects 2.5 Library
Dim iMsg As CDO.Message
Dim iConf As CDO.Configuration
Dim Flds As ADODB.Fields
Dim strHTML As String
On Error GoTo HandleErr
Set iMsg = New CDO.Message
Set iConf = iMsg.Configuration
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"propexbe.propeople.org"
..Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10
.Update
End With
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b><p>Please let me know if you got an attachment and
if you could open it. Thanks.</p></b></br>"
strHTML = strHTML & "<b><p>Also please let me know if the text of the
message is bold. Thanks. </b></p>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
With iMsg
Set .Configuration = iConf
.To = "(e-mail address removed)"
' .CC = "(e-mail address removed)"
.From = "(e-mail address removed)"
.Subject = "Please read: test CDOSYS message with Attachment13"
.HTMLBody = strHTML
.Send
End With
MsgBox "Mail Sent!"
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
ExitHere:
Exit Sub
HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical,
strProcName
End Select
End Sub