Solved

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

Posted on 2015-02-11
3
219 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now