send (Document - Java)

Mails a document.

Defined in

Document

Syntax

public void send()
    throws NotesException
public void send(String recipient)
    throws NotesException
public void send(java.util.Vector recipients)
    throws NotesException
public void send(boolean attachform)
    throws NotesException
public void send(boolean attachform, String recipient)
    throws NotesException
public void send(boolean attachform, java.util.Vector recipients)
    throws NotesException
Note: The send() and send(boolean) methods are new with Release 6.

Parameters

String recipient

The recipient of the document. See information that follows.

java.util.Vector recipients

Vector of String elements. The recipients of the document. See the information that follows.

boolean attachform

If true, the form is stored and sent along with the document. If false, it isn't. Do not attach a form that uses computed subforms.

Usage

The following rules apply to specification of the recipient or recipients:

  • Ignored if the document contains a SendTo item, in which case the document is mailed to recipients listed in SendTo.
  • Required if the document does not contain a SendTo item.
  • May include people, groups, or mail-in databases.

If you have only Reader access to a database, you can run an agent that creates and sends a document, but the agent will not work if you attach a file to that document.

Two kinds of items can affect the mailing of the document when you use send:

  • If the document contains additional recipient items, such as CopyTo or BlindCopyTo, the documents mailed to those recipients.
  • If the document contains items to control the routing of mail, such as DeliveryPriority, DeliveryReport, or ReturnReceipt, they are used when sending the document.

The IsSaveMessageOnSend property controls whether the sent document is saved in the database. If IsSaveMessageOnSend is true and you attach the form to the document, the form is saved with the document.

Sending the form increases the size of the document, but ensures that the recipient can see all of the items on the document.

The send method automatically creates an item called $AssistMail on the sent document. The SentByAgent property uses this item to determine if a document was mailed by an agent.

If a program runs on a workstation, the mailed document contains the current user's name in the From item. If a program runs as an agent on a server, the mailed document contains the server's name in the From item.

Example