Solved

How to make copy of incoming mail go to other users

Posted on 2000-05-02
5
188 Views
Last Modified: 2013-12-18
I need to know how to construct an agent that will look in my mail file (even at unread messages) for a certain "Subject" string. When it see's it, it forwards a copy of the incoming message to 5 other Notes users mail files. This agent would obviously need to know if it has forwarded these messages already or not.
0
Comment
Question by:a6106a
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 100 total points
ID: 2771653
I shouldn't really give you this for only 60 points , but I am in a good mood today so ...

Create an agent called anything you want in your mail file.. And set it to run when "If New Mail has Arrived"

In the Initialize event of the agent put::

'Code Starts

    Dim Sess As New NotesSession
     Dim CurrentDoc As NotesDocument
     Dim MemoDoc As NotesDocument
     Dim ThisDB As NotesDatabase
     Dim Coll As NotesDocumentCollection
     Dim Body As NotesRichTextItem
     Dim i As Integer
     Dim YourName As NotesName
     Dim Recp(1 to 5) As String

     Recp(1) = "UserName1/Domain"
     Recp(2) = "UserName2@Domain.com"
     Recp(3) = "UserName3/Domain"
     Recp(4) = "UserName4/Domain"
     Recp(5) = "UserName5/Domain"

     Set ThisDB =  Sess.CurrentDatabase
     
     ' Get all of the newly recieved documents
     
     Set Coll = ThisDb.UnprocessedDocuments
     Set YourName = New NotesName(Sess.EffectiveUserName)
     
     For i = 1 To Coll.Count
         
          Set CurrentDoc = Coll.getnthdocument(i)
         
          If CurrentDoc.Subject(0) = "THE SUBJECT YOU ARE LOOKING FOR" Then
               
               Set MemoDoc = New NotesDocument(ThisDB)
               Set Body = MemoDoc.CreateRichTextItem("Body")
               Call Body.AppendText("----------- Auto Forwarded by " + YourName.Common + " ----------------")
               Call Body.AddNewLine(2)
               Call CurrentDoc.Rendertortitem(Body)
               MemoDoc.Form="Memo"
' Adjust the subject a little so if you forward it to yourself for some reason it does create a loop
               MemoDoc.Subject = CurrentDoc.Subject(0) + "."
               Call  MemoDoc.Send(False,Recp)
               
          End If
         
          Call Sess.UpdateProcessedDoc(CurrentDoc)
         
     Next i
     

' Code Ends

Change the "THE SUBJECT YOU ARE LOOKING FOR" to the subject you referred to in your question and setup the Recp(1 to 5) with the list of users you want..

Hope this helps !!
0
 

Author Comment

by:a6106a
ID: 2774424
Simon:
I will contstruct all this and let you know. If all goes well, since I am in a good mood, I'll up to 100 points.
bob
0
 

Author Comment

by:a6106a
ID: 2776613
Adjusted points from 60 to 100
0
 

Author Comment

by:a6106a
ID: 2776614
fine job.
Thanks..
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2776628
Thanks ...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 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