'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim bMail
'call the SendMail function
bMail = SendMail()
'if the message was sent successfully then return success else return failure
If bMail = True Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
End Function
Function SendMail()
On Error Resume Next
Dim myMail
Set myMail=CreateObject("CDO.Message")
myMail.Subject="New AgeIn Load"
myMail.From="server@company.com"
myMail.To= "Someone@company.com"
myMail.TextBody="Hi John, " & Chr(13) & Chr(13) _
& "This Is Where you type Body"
& Chr(13) & Chr(13) _
& "Thanks," & Chr(13) & "<auto generated message>"
myMail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")=2[/URL]
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] _
="111.11.1.11"
'Server port
myMail.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
If ErrorCount <> 0 Then
SendMail = False
Else
SendMail = True
End If
End Function