Generating automatic mail always leave behind a draft?

Hi,

I design this simple mail sending agent that gather data from a certain incoming mail then compose a new mail with those data and send to a LN mail recipient. Everything works fine but when I check the Draft view there is always a draft copy of that sent mail.

What can I do to not have that draft copy since it can accumulate real fast on that draft view?

Here is the sending part of my agent code:


Sub LoadMemoAndSend

'If there is server entries on the incoming mail, -'copy those to a new table then send to Tier-3 group

If totalrowServer > 0 Then

	'Define for mail output

	Dim session As New NotesSession

	Dim db As NotesDatabase

	Dim rowCount As Integer, columnCount As Integer, iColumn As Integer

	Set db = session.CurrentDatabase

      REM Create document with Body rich text item

	Dim doc As New NotesDocument(db)

	Call doc.ReplaceItemValue("Form", "Memo")

	Call doc.ReplaceItemValue("Subject", "Disconnected Main Controllers Alert")

 	'******************** To be changed to list of recipients ********************

	Call doc.ReplaceItemValue("SendTo", "John Doe/Houston/IBM")

	'*******************************************************************************

	Dim body As New NotesRichTextItem(doc, "Body")

	

       REM Create table in Body item

	rowCount% = totalrowServer + 1

	columnCount% = 4

	Call body.AppendTable(rowCount%, columnCount%)

      REM Populate table

	Dim rtnav As NotesRichTextNavigator

	Set rtnav = body.CreateNavigator

	Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL) 

	For iRow% = 1 To rowCount% Step 1

		For iColumn% = 1 To columnCount% Step 1

			Call body.BeginInsert(rtnav)

			Call body.AppendText(ServerArray(iRow%,iColumn%))

			Call body.EndInsert

			Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

		Next

	Next

       REM Save document and refresh view

	Call doc.Save(True, False)

	Call doc.Send(False)

End If

End Sub


I appreciate any help and/or suggestion on how to kill that remnant draft copy, anytime the above code is executed.

Many thanks in advance.

Subject: Generating automatic mail always leave behind a draft??

The issue is with these lines:

Call doc.Save(True, False)

Call doc.Send(False)

If you want to save a copy in your Sent view, Send first, then Save.

If you don’t want to save a copy at all, remove the Save.

Subject: RE: Generating automatic mail always leave behind a draft??

Thank you very much. That did it. I thought that since it is a richtext field, I have to save it first before send it.

Again, thanks for your help.