Agent that Send email (2nd post)

Dear All,

I have an agent that will send email to some person in the documents listed in a view, the log says it works but no email ever sent or received.

this is 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

any help are very appreciated.

Thaks

Yusuf Abdella

Subject: Agent that Send email (2nd post)

Is it not sending mail because dif is never exactly equal to 1?

Can you make it run the trigger is dif is not equal to 1? Or greater than 1 and less than 2?

HTH

Kirsty

Subject: RE: Agent that Send email (2nd post)

Dear Kristy,

I have changed as your suggestion and it works when I triger from action menu.

But now I have changed the triger become schedule and no mail have been sent, any other configuration I should aware of?

Thanks

Yusuf Abdella