Link to home
Start Free TrialLog in
Avatar of Harsh Kumar
Harsh KumarFlag for Denmark

asked on

Lotus notes - forward mails agent with these conditions in subject,

Hi guys,

I urgently need some help, with a lotus agent/script that can forward mails from the inbox to a mailadress/mailgroup if it contains 2 specific word in the subject.

The user have restrictions to create the mail rule "send copy to" so sadly that's a option we do not have. The user are allowed to create agents in their mailbox

kindly advise.
Avatar of Harsh Kumar
Harsh Kumar
Flag of Denmark image

ASKER

I found this code,

but i'm not sure how I add if it contains "AAAA" and "BBBB"

Sub Initialize
	Dim s As New NotesSession 
	Dim db As NotesDatabase 
	Dim doc As NotesDocument 
	Dim newdoc As NotesDocument 

	Set db=s.CurrentDatabase 
	Set doc=s.Documentcontext 
	Set newdoc = db.CreateDocument 

	Call doc.CopyAllItems(newdoc, True) 
newdoc.Subject="Fwd: "& newdoc.Subject(0) 
	newdoc.CopyTo="" 
	newdoc.BlindCopyTo="" 
	Call newdoc.Send(False, "XXXX@XXXX.com")
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
works like a charm thank you sooo much!!!