Manage Learn to apply best practices and optimize your operations.

Setting up return receipts for LotusScript-generated Lotus Notes email

Discover how to implement the Lotus Notes return receipt feature for LotusScript-generated email messages.

The Lotus Notes return receipt feature allows the email sender to be notified when the recipient opens the sent document. The LotusScript code in this tip shows how to implement this feature in a LotusScript-generated email message.

The ReturnReceipt field is a default field included in the default Lotus Notes mail template. When this field is set to "1," the Lotus Notes sender is notified when an email message has been opened for the first time. After it is opened, the Lotus Notes mail template automatically sets a flag on the email to signify that the return notification has been triggered.

In my example below, an email is sent to the Lotus Notes user that clicks the button. The return receipt is then generated after the email is opened in Lotus Notes.

Sub Click(Source As Button)

Dim s As NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set s = New NotesSession
Set db = s.CurrentDatabase
Set doc = New NotesDocument(db)
'------------------------------------------------
----------------------
' Create the memo header
'-------------------------------------------------
---------------------
Dim Person As NotesName
Dim rtitem as NotesRichTextItem
Set Person = New NotesName
(s.UserName)
doc.Form = "Memo"
doc.SendTo = Person.Abbreviated
' doc.SendTo = "john doe/org/company"
doc.Subject = "This is the message 
subject"
doc.ReturnReceipt = "1"
'-----------------------------------------------------
-----------------
' Create the email message body
'-----------------------------------------------------
-----------------
Set rtitem = New NotesRichTextItem
(doc, "Body") Call rtitem.AddNewLine(1) 
Call rtitem.AppendText("This is the body 
of the email message.") 
Call rtitem.AddNewLine(1)

'------------------------------------------------------
----------------
' Send the email notification
'------------------------------------------------------
----------------
doc.Send (False)
msgbox "An email has been sent."

End Sub

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Will Wayne. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Dig Deeper on LotusScript

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close