markgrizzle
Programmer
Hi All:
When the SendEmail function is called, nothing happens. Can anyone tell me what's missing? If you haven't already guessed, I'm new to SQL Server (2000)
Thanks in advance,
Mark
Main()
...
Call SendEmail(msg)
End Function
Function SendEmail (msg)
Dim iMsg
Dim iConf
Dim flds
'use CDO Send Using Pickup in this example
Const cdoSendUsingPickup = 1
'use COM to create Message and Configuration Objects
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
'set the field to the configuration objects fields
Set flds = iConf.Fields
'set the field namespaces to variables/constants
With flds
.Item(" configuration/sendusing")
= cdoSendUsingPickup
.Item(" configuration/smtpserver")
= "smtp.xxx.com"
.Item(" configuration/smtpconnectiontimeout")
= 10
.Update
End With
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = "xxx@xxx.com"
.From = "xxx@xxx.com"
.Subject = "Update Prod Data - Import tblTemplate DTS Package Failed"
.TextBody = msg
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function 'SendEmail
When the SendEmail function is called, nothing happens. Can anyone tell me what's missing? If you haven't already guessed, I'm new to SQL Server (2000)
Thanks in advance,
Mark
Main()
...
Call SendEmail(msg)
End Function
Function SendEmail (msg)
Dim iMsg
Dim iConf
Dim flds
'use CDO Send Using Pickup in this example
Const cdoSendUsingPickup = 1
'use COM to create Message and Configuration Objects
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
'set the field to the configuration objects fields
Set flds = iConf.Fields
'set the field namespaces to variables/constants
With flds
.Item(" configuration/sendusing")
= cdoSendUsingPickup
.Item(" configuration/smtpserver")
= "smtp.xxx.com"
.Item(" configuration/smtpconnectiontimeout")
= 10
.Update
End With
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = "xxx@xxx.com"
.From = "xxx@xxx.com"
.Subject = "Update Prod Data - Import tblTemplate DTS Package Failed"
.TextBody = msg
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function 'SendEmail