Solved

How to make copy of incoming mail go to other users

Posted on 2000-05-02
5
185 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

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

Title # Comments Views Activity
Lotus notes email code 13 90
Add code to Lotus Notes view column 2 116
Lotus Notes Calendar Issue 5 105
How to auto purge mail to keep latest one month mail of a replica? 4 95
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
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 …

920 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

14 Experts available now in Live!

Get 1:1 Help Now