Solved

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

Posted on 2015-02-11
3
262 Views
Last Modified: 2015-02-11
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.
0
Comment
Question by:Hakum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:Hakum
ID: 40602818
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

0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 40602883
Should be something like this:

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 

	If Not(Instr(doc.Subject(0), "AAAA")>0 And Instr(doc.Subject(0), "BBBB")>0) Then
		Exit Sub
	End If

	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

0
 
LVL 1

Author Closing Comment

by:Hakum
ID: 40602916
works like a charm thank you sooo much!!!
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question