Manage Learn to apply best practices and optimize your operations.

Forwarding mail one by one

This agent is for forwarding mail one by one to a single email id.
Follow the steps below to create it:

1.Open the mail database.
2.Select "Create->Agent" in main menu.
3.Give the name of agent as "Forwarding one by one".
4.In "When this agent should run" should be "Manually from Actions menu"
5.In "Which document(s) should it act on" should be "selected documents"
6.In "What should this agent do" select script and paste the code given below
in initialize event in "Sub Initialize" and "End Sub" Follow the steps to run it. 1.Select the mail documents you want to send. the Actions-->Forwarding one by one in main menu. 3.It will ask for the email id. Give the email id you want to send the documents to. Code: Dim session As New NotesSession Dim db As NotesDatabase Dim collection As NotesDocumentCollection Dim doc As NotesDocument Dim doc1 As notesdocument Dim rtxt As Variant Dim subtxt As String Dim sndto As String sndto=Inputbox("Please enter the e-mail id of the person to which you
want to forward mails") If sndto="" Then Exit Sub End If Set db = session.CurrentDatabase Set collection = db.UnprocessedDocuments For i = 1 To collection.Count Set doc = collection.GetNthDocument( i ) subtxt = doc.subject(0) Set rtxt=doc.getfirstitem("body") Set doc1=New notesdocument(db) doc1.sendto=sndto doc1.form="memo" doc1.posteddate=Now doc1.delivereddate="" doc1.subject="Forwarded Mails Re:"+subtxt Call rtxt.CopyItemToDocument(doc1, "Body") Call, False) Call doc1.send(False) Next

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • 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 ...