LotusScript: Creating agent that loops calls and sends out emails

5 pts.
Tags:
Body of e-mail
LotusScript
NotesRichTextItem
Web application development
I'm creating an agent that loops through 6 different calls that eventually sends out e-mails. I'm using a field called rtBody which is described as a NotesRichTextItem. In order to build each e-mail I use AppendText. Each each has the previous e-mails wording and also it's wording attached to the e-mail. So the last e-mail sent is a combination of all the e-mails sent before it before the loop ends. How can I blank out rtBody before rebuilding it within each e-mail?

Answer Wiki

Thanks. We'll let you know when a new response is added.

After each mail is sent, you can re-initialize the rich text field And the mail document using Delete to get rid of the existing object. Each entry into the loop should use New (or CreateXXX) to get a new object:

For i = 1 To 6
Set maildoc = db.CreateDocument
.
. ‘Set subject, recipient fields
.
Set rtBody = New NotesRichTextItem(maidoc, “Body”)
.
. ‘append message text, doclinks, etc.
.
Call maildoc.Send(False)
Delete rtBody
Delete maildoc
Next

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Brooklynegg
    Have you tried remove, or removeItem in the notesdocument class?
    3,845 pointsBadges:
    report

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following