[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to make copy of incoming mail go to other users

Posted on 2000-05-02
5
Medium Priority
?
197 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 400 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

868 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