Hi All,
One common question I get about this article is about the email not working. The article's example assumes you have a valid, open relay SMTP service running from your client or SQL Server instance machine.
If you don't, here is a code example of referencing a remote SMTP service:
Dim objMail
Const cdoSendUsingPort = 2
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'Change this parameter below to your valid SMPT Server Name
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="10.10.10.99"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
Set .Configuration = iConf
.AddAttachment ( "c:\temp\test.xls")
.Subject="Test Spreadsheet"
.TextBody = "Spreadsheet"
.Send
End With
End Function