Agent that compares date then send email (code and agent log) - Not working, why?

Dear All,

I develop an agent that will evaluate all document in a view to compares the date/time field value to “Today” date then the agent wills send a message to “participant” field value (names field in the document) to remind them about the document.

The log says that the agent run well but no email have been sent/received…

Any clue…??

Thanks a lot.

Here the code :

Sub Initialize

Dim ses As New NotesSession

Dim db As NotesDatabase

Dim vw As NotesView

Dim doc1 As NotesDocument 'doc to evaluate 

Dim doc0 As NotesDocument 'doc to last document



Dim nowdate As New NotesDateTime("Today")

Dim evaldate As New NotesDateTime("Today")



Dim flag As Integer

Dim dif As Long



Set db = ses.CurrentDatabase

Set vw = db.GetView("notpassed")

Set doc1 = vw.GetFirstDocument

Set doc0 = vw.GetLastDocument



flag=1



If vw.EntryCount<>0 Then

	While flag=1

		'date comparison goes here

		times=doc1.GetItemValueDateTimeArray("StartDate")

		Forall t In times

			evaldate.LocalTime=t.LocalTime

			dif=nowdate.TimeDifference(evaldate)/86400

			If dif=1 Then

				Call doc1.Send( True, doc1.Participants )					

			End If

		End Forall

		If doc1.NoteID=doc0.NoteID Then

			flag=0				

		End If

		Set doc1=vw.GetNextDocument(doc1)

	Wend		

End If		

End Sub

Here the agent log :

Started running agent ‘Next Day Alert’ on 10/06/2006 09:40:51 AM

Running on selected documents: 1 total

Found 1 document(s) that match search criteria

Ran LotusScript code

Done running agent ‘Next Day Alert’ on 10/06/2006 09:40:51 AM