Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
On Error Resume Next
Set objGroup = GetObject _
("LDAP://cn=Scientists,ou=R&D,dc=NA,dc=fabrikam,dc=com")
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
WScript.Echo "Members:"
For Each strMember in arrMemberOf
WScript.echo strMember
Next
[green]
'==========================================================='
' NAME: SendMailTogroupMembers.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 12/24/2007
' COPYRIGHT (c) 2007 All Rights Reserved
'
' COMMENT:
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'===========================================================
On Error Resume Next
Dim strFrom, strMyIP, strTo
Dim priorityFlag, strSubject, strBody, objUser, objGroup
[red]
'***********************************************************
'***********************************************************
'Begin Modification section[/red][green]
' Set the company specific information['green]
strFrom = "mark@thespidersparlor.com"[green]
' Set the SMTP server IP[/green]
strMyIP = "192.168.0.13" [green]
' Set the subject text[/green]
strSubject = "Important Message to Group X"[green]
' Set the body text[/green]
strBody = "Due to bedgetary constraints, you will only be paid 50% salary for any days worked that end in a Y"[green]
' Set the priority to high importance. Change to any other value for normal priority"[/green]
priorityFlag = "Yes"[green]
' Specify the group object LDAP Path [/green]
Set objGroup = GetObject _
("LDAP://cn=Scientists,ou=R&D,dc=NA,dc=fabrikam,dc=com")[red]
' End modification section
'***********************************************************
'***********************************************************
[/red]
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
For Each strMember in arrMemberOf
Set objUser = GetObject("LDAP://" & strMember)
strEmail = Replace(objUser.mail,"@","@internal.")
emailList = emailList & strEmail & ";"
Next
strTo = emailList
[green]
' Set the visual basic constants as they do not exist within VBScript.
' Do not set your smtp server information here.[/green]
Const cdoSendUsingMethod = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing",[/URL] _
cdoSendUsingPort = 2, _
cdoSMTPServer = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver"[/URL]
[green]
' Create the CDO connections.[/green]
Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
[green]
' SMTP server configuration.[/green]
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
[green]
' Set the SMTP server address here.[/green]
.Item(cdoSMTPServer) = strMyIP
.Update
End With
[green]
' Set the message properties.[/green]
With iMsg
Set .Configuration = iConf
.To = strTo
.From = strFrom
.Subject = strSubject
.TextBody = strBody
End With
[green]
'Send high priority[/green]
If priorityflag = "Yes" Then
iMsg.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High" ' For Outlook 2003
iMsg.Fields.Item("urn:schemas:mailheader:X-Priority") = 2 ' For Outlook 2003 also
iMsg.Fields.Item("urn:schemas:httpmail:importance") = 2 ' For Outlook Express
iMsg.Fields.Update
End If
[green]
'Send the message.[/green]
iMsg.Send
MsgBox "Done"
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Subject"
objMessage.From = "me@company.com"
objMessage.To = "juser1@company.com"
objMessage.TextBody = "This is some sample message text."
objMessage.Send