Auto reply for resigned employees

Dear All,

I would like to set up an auto-reply that in case recipients are already disconnected with the Company, that the agent/auto-reply will inform the sender that employee is no longer connected and instead e-mail or contact another person within the company.

I have found this LS in Lotus 7 forum but really don’t have any idea on how to use it and also don’t know if this really works:


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


Will greatly appreciate any advise/help on this.

Thank you in advance.

Edwin G.