Auto Reply agent similar to OOO

I would like to set up an auto reply agent to run when an employee receives email, to inform the sender that the person doesn’t work here anymore and to contact another employee.

I thought about modifying the OOO agent, but that seems incredibly hard to do without some help.

If I do alter the OOO agent, I though I can have an additional checkbox that when checked, changes the message that’s sent to say my own message.

Subject: Auto Reply agent similar to OOO

I thought about using OOO but opted to just write an agent that replied upon the event After New Mail has arrived.

Unfortunately, I don’t have the code any longer - but AFAIR it wasn’t very complex and if needed I’m sure I could help write something.

It was just get the e-mail address.

Create a richtext field - with the info you want to reply with.

Send the e-mail.

Subject: Auto Reply agent similar to OOO

Here you go…

Sub Initialize

  ' Initialise

Dim session As New NotesSession      

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim docNext As NotesDocument

Dim view As NotesView

Dim rtitem As Variant     

Dim collection As NotesDocumentCollection

Dim dateTime As New NotesDateTime( "01/01/2004" )  



Set db = session.CurrentDatabase   



 ' Process each new mail document     

Set view = db.GetView( "($Inbox)" )

Set doc = view.GetFirstDocument



While Not ( doc Is Nothing )

	Set docNext = view.GetNextDocument( doc )

	

	If (doc.Form(0) = "Memo" Or doc.Form(0) = "Reply") Then               

		If doc.processed(0) <> "" Then

                ' do nothing - already processed

		Else

               ' Incoming email               

			Set mailDoc = db.CreateDocument

			Set rtitem = mailDoc.CreateRichTextItem("Body")

			mailDoc.Subject = "Email Acknowledgement"

			mailDoc.Principal = "email address"

			mailDoc.Form = "Memo"

			

			Set notesDocument = doc     

			

			Call rtitem.AppendText("Due to unforeseen circumstances, there will be no one available to answer technical queries via either e-mail or telephone. ")              

			

			Call mailDoc.Send(False, doc.From)     

			

                '    Call doc.PutInFolder( "1. Processed Emails" )

			doc.processed = Now

			Call doc.save(True, True)               

		End If

	End If

	

	Set doc = docNext

	

Wend

End Sub

Subject: RE: Auto Reply agent similar to OOO

Thanks so much, you were both very helpful.

Subject: RE: Auto Reply agent similar to OOO

Hi.

I’m really new with Domino…

Just want to ask how will I use the script?

Thank you so much!