08-18-2010, 05:53 PM
Create a folder for that particular Type of mail
and check in that folder
Has this answred your question?
and check in that folder
Code:
Option Explicit
Dim dicEmailAddresses
Dim strLogFolder
Dim strEmail
strLogFolder = "C:Program FilesSpare BackupLogs"
Set dicEmailAddresses = GetEmailAddressesFromLogs(strLogFolder)
For Each strEmail In dicEmailAddresses.Keys()
WScript.Echo strEmail
Next
Function GetEmailAddressesFromLogs(StrSource)
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim oFolder
Dim strLine
Dim dicResults
Dim strEmail
Dim oFile
Set oFile = oFSO.GetFolder(strLogFolder)
Set dicResults = CreateObject("Scripting.Dictionary")
For Each oFile In oFSO.GetFolder(strSource).Files
For Each strLine In Split(oFile.ReadAll(), VbCrLf)
If InStr(strLine, "INFO: Logging in ") > 1 Then
strEmail = Split(strLine, "INFO: Logging in ")(1)
If Not dicResults.Exists(strEmail) Then
dicResults.Add strEmail, ""
End If
End If
Next
Next
Set GetEmailAddressesFromLogs = dicResults End Function