Send Copy Of Email And Keep Original

If you set the Forward Email Address in the Person Document it forwards, but
does not save the email in the original mail database.

I have used this code before, and it will send out a copy of any new EMail, but
leave the existing EMail in tact.

In the users Lotus Notes Mail Database, create a new agent. (Note: the user
must have rights to run agents on the mail server.)

Name it, and select the "When should this agent run?" option of "If New Mail
Has Arrived".

For "What should this agent run?" choose "Script" and place the following code
into the Initialize Event.

Replace the "Put EMail address here" with real addresses and be sure to leave
the quotes("") around the address.

i.e. My address would look like this:
Call doc.Send( False, "" )

Hope you will find this benficial.
- - Bob
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim memo As NotesDocument
Dim doc As NotesDocument
Dim j As Integer
Set db = session.CurrentDatabase

REM get new mail memos
Set collection = db.UnprocessedDocuments

For j = 1 To collection.Count
Set memo = collection.GetNthDocument( j )
If Not( memo.SentByAgent ) Then
Set doc = New NotesDocument( db )
doc.Form = "Memo"
doc.Subject = memo.Subject( 0 )
doc.Body = memo.Body
You must make sure that the recipient doesn't have an agent set to send back to
this database before turning the next statement on! You would be in a bad loop.
'Call doc.Send( False, "Put EMail address here" )
'Call doc.Send( False, "Put another EMail address here" )
End If
Call session.UpdateProcessedDoc( memo )
End Sub

Dig Deeper on Domino Resources



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...