Manage Learn to apply best practices and optimize your operations.

Easy Way To Get Route Of Incoming Mail

Tracing the inbound route of mail became more difficult in R5 when the
$additionalheader field was replaced with multiple received fields. My
colleague, Mike Smolnicki, came up with the following way to capture the
inbound route of mail for R5:
Copy the memo form and rename copy SMTP form. On the SMTP form, add a text
editable field called additionalheaders. Then add a button "SMTP" with the
following script in the "On Click event."

When a user needs to trace the inbound path of a mail memo, ask them to switch
forms to the SMTP form, and click the SMTP button which will put the route in
the additionalheader field. Then ask the user to forward the switched memo to
you.

Sub Click(Source As Button)
' uidoc
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

'doc declarations
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As notesdocument
Dim k As Integer, n As Integer
Dim headersItem As NotesItem

Set db = session.CurrentDatabase
Set doc = uidoc.document
uidoc.EditMode = True
Set headersItem = doc.GetFirstItem("AdditionalHeaders")

'determine how many items in doc have the name Received
k = 0
Forall item In doc.Items
If item.Name = "Received" Then
k = k + 1
End If
End Forall

For n = 1 To k
Forall item In doc.Items
If item.Name = "Received" Then
Call uidoc.FieldAppendText("AdditionalHeaders",item.Text & " . . . . . . .
")
Call item.Remove
Exit Forall
End If
End Forall
Next
End Sub

Sub Click(Source As Button)
' uidoc
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

'doc declarations
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As notesdocument
Dim k As Integer, n As Integer
Dim headersItem As NotesItem

Set db = session.CurrentDatabase
Set doc = uidoc.document
uidoc.EditMode = True
Set headersItem = doc.GetFirstItem("AdditionalHeaders")

'determine how many items in doc have the name Received
k = 0
Forall item In doc.Items
If item.Name = "Received" Then
k = k + 1
End If
End Forall

For n = 1 To k
Forall item In doc.Items
If item.Name = "Received" Then
Call uidoc.FieldAppendText("AdditionalHeaders",item.Text & " . . . . . . .
")
Call item.Remove
Exit Forall
End If
End Forall
Next
End Sub

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close