?
Solved

How to make copy of incoming mail go to other users

Posted on 2000-05-02
5
Medium Priority
?
194 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
[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
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 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