Mailing a document in Java classes

Use the send method of Document to mail a document. You can specify the recipient or recipients in the first parameter or omit the parameter and use the SendTo field of the document. Specify the second parameter as true to include the form in the mailed document.

To save the document after it is mailed, you can set isSaveMessageOnSend to true before mailing the document.

To sign the mail, use isSignOnSend or sign in Document before sending the mail. Use save afterwards if you want to save the signature. You can check for a signature with isSigned, and get the signer and signature verifier with getSigner and getVerifier.

To encrypt the mail, set encryptOnSend in Document to true before sending the mail. Do not use the encrypt method.

Use createReplyMessage in Document to create a new document that is a reply to the current document. The new document uses the default mail form for replies.

Use isSentByAgent in Document to determine if a message was generated programmatically.