Forwading of mails,Urgent help required

Hi I am creating an agent which will forward the mails,and i have set it on after new mail arrives.But it does not work,I am also pasting the code.I am writing script b’coz i want exact subject in the subject line. I tried to create the agent from send mail ,but i still don’t know whether from there i can send the mail and can get the exact subject.

Sub Initialize

Dim ws As New notesuiworkspace

Dim session As New NotesSession 

Dim uidoc As notesuidocument

'Dim note As NotesDocument

Dim dbug As NotesLog

Dim db As NotesDatabase

Dim it As NotesItem

Dim dt As Variant

Set session = New NotesSession

Set sourcedb = session.CurrentDatabase

Set uidoc=ws.CurrentDocument

Set doc=sourcedb.UnprocessedDocuments

Count = doc.Count

REM Log steps in our processing for debug purposes

Set dbug = New NotesLog("Router log")

dbug.LogActions = True

dbug.OpenAgentLog

dbug.LogAction("begin")



Set db = session.CurrentDatabase

REM Make sure we have the note set correctly

If db Is Nothing Then dbug.LogAction("db is not set") Else dbug.LogAction("db is set")



Set view=db.getview("($VIM23)")		

Set note = view.Getlastdocument		











Set mdoc = New NotesDocument( db )

Dim rtitem2 As NotesRichTextItem

Set rtitem2 = New NotesRichTextItem( mdoc, "Body" )

mdoc.Form="Memo"

mdoc.SendTo="dali@yahoo.com"



mdoc.Subject="FWD:-"+note.subject(0)	



Call rtitem2.AppendText(note.Body)

Call mdoc.Send(True)		



Call session.UpdateProcessedDoc(note) 	





dbug.Close 

End Sub

Subject: Forwading of mails,Urgent help required

There are already some built-in agents that will just work fine like the one which will send a full copy of the document to a specific address … no need to develop a lotusscript agent, it’s just a waste of time.

Subject: RE: Forwading of mails,Urgent help required

Don’t use the UI doc reference. It does not work in the lotus agents.

I had a same problem in the past. If still does not work, let me know. I will send the code for you, as i am using to send specific filtered mail on yahoo or hotmail account.

Subject: RE: Forwading of mails,Urgent help required

Kindly send me the code

Subject: Forwading of mails,Urgent help required

Try looking at Tools->Rules->New Rule->all documents->Send Copy To