Public Function checkEmail() As String
Dim returnNoteID As String = Nothing
open()
Dim subj() As String
Dim cats() As String
Dim nDateTime As NotesDateTime = domS.CreateDateTime("")
nDateTime.SetNow()
nDateTime.AdjustMinute(DETECT_EMAIL_WITHIN_MIN)
Dim dc As NotesView = domDB.GetView("($InBox)")
domDoc = dc.GetFirstDocument
Dim ni As NotesItem
Dim nis() As NotesItem
Dim current_subject As String
Dim current_starttime As String
Dim current_endtime As String
Dim domDocDel As NotesDocument
While Not (domDoc Is Nothing)
domDocDel = Nothing
current_subject = CStr(domDoc.GetItemValue("Subject")(0))
current_starttime = current_subject.Replace(sSubjectDetectfilter, "").Trim
If current_subject.IndexOf(sSubjectDetectfilter) > -1 Then
'If Now.Subtract(DateTime.Parse(domDoc.GetItemValue("PostedDate")(0))).TotalMinutes < DETECT_EMAIL_WITHIN_MIN Then
'Dim strs() As String = doc.ColumnValues()
llog1.write(current_starttime)
llog1.write(" ~ ")
llog1.write(CDate(domDoc.GetItemValue("DeliveredDate")(0)).ToString("yyyy-MM-dd HH:mm:ss"))
llog1.write(" ")
llog1.write("Result: Successful" + " " + CStr(domDoc.GetItemValue("Subject")(0)) )
llog1.writeline("")
End If
domDoc = dc.GetNextDocument(domDoc)
If domDocDel Is Nothing = False Then
domDocDel.RemoveFromFolder("($InBox)")
End If
End While
domDoc = Nothing
domVE = Nothing
domVN = Nothing
domV = Nothing
close()
Return returnNoteID
End Function
|