Subject: Script Library for Controlling the ‘From’ name
Hi Sara,
We have a script library you can freely download from our website that enables you to set the value of the ‘From’ field to whatever you want. We use it for all our auto-responder web agents and for ad-hoc emails where we can set the sender name on the fly.
The script library handles all the necessary message formatting, address resolution, etc. All you need to do is call the methods and pass the message data and away you go.
Subject: RE: Mail agent in LS to control sender name
This code will work in your agent and will also check your conditions…
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim docMail As NotesDocument
Dim doc As notesdocument
Dim RTItem As NotesRichTextItem
Set db=session.currentDatabase
Set doc = session.DocumentContext
Set docMail = New NotesDocument(db)
If (doc.status(0) = "Planed" And doc.step(0) = "Normal") Then
Set RTItem= New NotesRichTextItem(docMail,"Body")
email1$=Inputbox("Please, inform recipient")
subj$=Inputbox("Please, inform Subject")
msg$=Inputbox("Please, inform text")
docMail.Subject=subj$
Call RTItem.AppendText(msg$)
Call docMail.send(email1$,False)
Else
Exit Sub
End If
Subject: RE: Mail agent in LS to control sender name
The agent I’m looking for is a scheduled agent that runs every hour on new or modified documents.It should check if (field “step” =“Normal” and filed “status” = “planed”) if its true send mail to special person if not do nothing.