D
DS
I have this code that works very well, except I want to send the contents of
a small report in the body of an E-Mail. Right now I'm transferring the
report to a txt file, works fine. How can I get that to the body of the E-
Mail?
Const cdoSendUsingPort = 2
Const cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object
Dim strSch As String
strSch = "http://schemas.microsoft.com/cdo/configuration/"
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingPort
.Item(strSch & "smtpserver") = "mail.optonline.net"
.Item(strSch & "smtpauthenticate") = cdoBasic
.Item(strSch & "sendusername") = "Big Corp"
.Item(strSch & "sendpassword") = "99"
.Update
End With
Set objCDOMessage = CreateObject("CDO.Message")
With objCDOMessage
Set .Configuration = objCDOConfig
.FROM = "Big Corp"
.sender = "(e-mail address removed)"
.TO = "(e-mail address removed)"
.subject = "SALES UPDATE"
.TextBody = "This should be the contents of the text file that is
from the report "
.SEND
End With
Set objCDOMessage = Nothing
Set objCDOConfig = Nothing
Thanks
DS
a small report in the body of an E-Mail. Right now I'm transferring the
report to a txt file, works fine. How can I get that to the body of the E-
Mail?
Const cdoSendUsingPort = 2
Const cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object
Dim strSch As String
strSch = "http://schemas.microsoft.com/cdo/configuration/"
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingPort
.Item(strSch & "smtpserver") = "mail.optonline.net"
.Item(strSch & "smtpauthenticate") = cdoBasic
.Item(strSch & "sendusername") = "Big Corp"
.Item(strSch & "sendpassword") = "99"
.Update
End With
Set objCDOMessage = CreateObject("CDO.Message")
With objCDOMessage
Set .Configuration = objCDOConfig
.FROM = "Big Corp"
.sender = "(e-mail address removed)"
.TO = "(e-mail address removed)"
.subject = "SALES UPDATE"
.TextBody = "This should be the contents of the text file that is
from the report "
.SEND
End With
Set objCDOMessage = Nothing
Set objCDOConfig = Nothing
Thanks
DS