Additional Functionality For "Send Mail Message"

The following Lotuscript will provide additional functionality over using the
Simple Action "Send Mail Message" or the @MailSend function.

Using Lotuscript, you can change the font attributes of the body text to
include color changes and other text attributes such as bold, italic,
underline, size, etc.

The script example also checks for the value of a couple fields. If the values
are Yes, a new paragraph is added to the e-mail with special instructions.

So the end result is an e-mail message which is very easy to comprehend. Most
of the data needed for the end-user to see is on the e-mail. This helps the
end-user know what they are about to approve/edit prior to launching the
doc-link.

You can run this script via an agent, button, etc. Anywhere you need to
forward a doc-link via script.

Let me know if you have any questions!
REM Lotuscript Mail Send Agent
REM Written by John Vester
REM Bell Industries, Inc.
REM April, 1999

REM Establish Elements
Dim db As NotesDatabase
Dim session As New NotesSession
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim maildoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim richstyle As NotesRichTextStyle

REM Set Environment
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments

REM Established Loop For Mail Agent
For i=1 To Collection.Count

Set doc = Collection.GetNthDocument(i)

REM Set variable values
DateofFunction$=doc.DateofFunction(0)
NumberofGuests$=doc.NumberofGuests(0)
Location$=doc.Location(0)
FunctionTime$=doc.Time(0)
ChargeToName$=doc.ChargeToName(0)
ChargeToAcct$=doc.ChargeToAcct(0)
Requested$=doc.Requested(0)
Servers$=doc.Servers(0)

REM Set Environment for e-mail messsage.
Set maildoc = New NotesDocument(db)
Set richstyle = session.CreateRichTextStyle
Set rtitem = New NotesRichTextItem(maildoc,"Body")

REM Create message, as described below:

REM Write original line in black text:
Call rtitem.AppendText("The following request has been submitted
online:")

REM Skip two lines and tab indent.
Call rtitem.AddNewLine( 2 )
Call rtitem.AddTab( 1 )

REM Write labels in black, the data in dark magenta.
Call rtitem.AppendText("Date of Function: ")
richstyle.NotesColor = COLOR_DARK_BLUE
Call rtitem.AppendStyle(richstyle)
Call rtitem.AppendText(Cstr(DateofFunction$))

REM Skip one line, tab indent and change color to black.
Call rtitem.AddNewLine( 1 )
Call rtitem.AddTab( 1 )
richstyle.NotesColor = COLOR_BLACK
Call rtitem.AppendStyle(richstyle)

Call rtitem.AppendText("Number of Guests: ")
richstyle.NotesColor = COLOR_DARK_BLUE
Call rtitem.AppendStyle(richstyle)
Call rtitem.AppendText(Cstr(NumberofGuests$))

REM Skip one line, tab indent and change color to black.
Call rtitem.AddNewLine( 1 )
Call rtitem.AddTab( 1 )
richstyle.NotesColor = COLOR_BLACK
Call rtitem.AppendStyle(richstyle)

Call rtitem.AppendText("Location: ")
richstyle.NotesColor = COLOR_DARK_BLUE
Call rtitem.AppendStyle(richstyle)
Call rtitem.AppendText(Cstr(Location$))

REM Skip one line, tab indent and change color to black.
Call rtitem.AddNewLine( 1 )
Call rtitem.AddTab( 1 )
richstyle.NotesColor = COLOR_BLACK
Call rtitem.AppendStyle(richstyle)

Call rtitem.AppendText("Function Time: ")
richstyle.NotesColor = COLOR_DARK_BLUE
Call rtitem.AppendStyle(richstyle)
Call rtitem.AppendText(Cstr(FunctionTime$))

REM Skip one line, tab indent and change color to black.
Call rtitem.AddNewLine( 1 )
Call rtitem.AddTab( 1 )
richstyle.NotesColor = COLOR_BLACK
Call rtitem.AppendStyle(richstyle)

Call rtitem.AppendText("Charge To (Name/Account): ")
richstyle.NotesColor = COLOR_DARK_BLUE
Call rtitem.AppendStyle(richstyle)
Call rtitem.AppendText(Cstr(ChargeToName$)+"/")
Call rtitem.AppendText(Cstr(ChargeToAcct$))

REM Change color to black.
richstyle.NotesColor = COLOR_BLACK
Call rtitem.AppendStyle(richstyle)
Call rtitem.AddNewLine( 2 )
<WHAT
This was first published in November 2000

Dig deeper on Lotus Notes Domino Administration Tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

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

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close