Video Screencast Help

Email person depending on site server

Created: 11 Sep 2013 | 1 comment

At them moment I have a script that sends an email to all tech support guys when a build completes. I would like to set it up so that only specific contacts are mailed depending on what site server did the build. anyone have any ideas/scripts for this ?


Operating Systems:

Comments 1 CommentJump to latest comment

BugTastic's picture

OK, just in case anyone else is looking for something similar as the Email function in NS7.1 doesn't work in client jobs (wacky! i know) - heres the script I used. It mails whoever is responsible for that site server build. Now I'm not a scripter so I assume it can be done more efficiently. But hey - it works.

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Subject of email goes here"
objMessage.From =

IF UCase("%SSTOKEN%") = "server1" Then objMessage.TO =
IF UCase("%SSTOKEN%") = "server2" Then objMessage.TO =
........repeat for each site server

objMessage.BCC =

objMessage.TextBody = "Body of mail text goes here "
objMessage.Configuration.Fields.Item("") = cdoSendUsingPort
objMessage.Configuration.Fields.Item("") = "MAILSERVER"
objMessage.Configuration.Fields.Item("") = cdoNTLM
objMessage.Configuration.Fields.Item("") = "domain\bigbob"
objMessage.Configuration.Fields.Item("") = "password"
objMessage.Configuration.Fields.Item("") = 25
objMessage.Configuration.Fields.Item("") = 60


I created a token for the site server (SSTOKEN) using this sql

select from TaskTargetDeviceCache vc left outer join Inv_Client_Task_Resources ctr on ctr._ResourceGuid = vc.Guid And vc.Guid = '%COMPUTERID%' left outer join Inv_Client_Task_Servers cts on cts.ClientTaskServerGuid = ctr.ClientTaskServerGuid Join vcomputer c on cts._ResourceGuid = c.guid