Quote:
Originally Posted by pradeep
hi pradeep,
i have written following code for E-mailing from VB script.
it is asking yes or no confirmation and though after giving confirmation, mail is not going.
can u help me on this and make it automatic.
Code:
Const olFolderContacts = 10
sDistName = "ipms" 'set the distribution list name here
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).Items
intCount = colContacts.Count
For i = 1 To intCount
If TypeName(colContacts.Item(i)) = "DistListItem" Then
Set objDistList = colContacts.Item(i)
sEmails = ""
If objDistList.DLName = sDistName Then
For j = 1 To objDistList.MemberCount
sEmails = sEmails & ";" & objDistList.GetMember(j).Address
Next
'send the mail using the emails u got! ;-) enjoy
End if
End If
Next
regards,
vipin gupta