Setting up automatic mailing

To send automatic mail notices from a database, you can use forms or use form and view actions, agents, and events.

Sending links to documents

In some workflow applications, you may want to mail notices of new or modified documents or reminders of work that needs to be done. Sending a link to a document instead of sending the document itself saves time and space. To send a link automatically, create an agent, event, form or view action, hotspot, or button that includes one of the following:

  • The simple action "Send Mail Message" with "Include link to document" selected.
  • The simple action "Send Newsletter Summary."
  • The formula function @MailSend with the [IncludeDocLink] flag.
  • A LotusScript® program that uses the Send method in either the NotesDocument class or the NotesUIDocument class and the FormatMsgWithDoclinks method in the NotesNewsletter class.
  • A Java program that uses the Send method in the lotus.notes.Document class and FormatMsgWithDoclinks method in the lotus.notes.Newsletter class.

Sending documents

Sometimes it makes sense to mail documents automatically, as in the following situations:

  • You want users to work on documents sequentially
  • You want to send documents to a mail-in database for centralized tracking

For these applications, you must create a form with a SendTo field field that specifies the recipients, or use a formula or program that includes the SendTo information.

Use any of these methods:

  • Add a MailOptions field with a value of 1 to force the document to be mailed when it is saved.
  • At the Defaults tab of the Form Properties box, select "On Close: Present mail send dialog" to let users decide if they want to mail the document.
  • Create an agent, event, form or view action, hotspot, or button that uses:
    • The simple action "Send Document"
    • The formula functions @Command([MailSend]) for optional mailing or @MailSend for automatic mailing
    • A LotusScript® program that uses the Send method of the NotesDocument class or the NotesUIDocument class
    • A Java program that uses the Send method of the lotus.notes.Document class

In addition, all forms and views contain the default action "Send Document" that you can display in the Actions menu or the action bar.

For more information on reserved fields for mailing options, see Reserved fields that control mailing options.

Enabling users to view documents

To allow users to view workflow documents, do one of the following:

  • Copy the form into the master mail template on the server and refresh the design of mail databases.
  • Select the "Store form in document" option for the form.

Forwarding documents in a mail memo

Use mail forwarding to mail documents that don't have a SendTo field. Create an agent, event, form or view action, hotspot, or button that uses one of the following:

  • The simple action "Send Mail Message" with the option "Include copy of document" selected
  • The formula function @Command([MailForward])
  • A LotusScript® program that uses the Forward method in the NotesUIDocument class

In addition, all forms and views contain the default action "Forward" that you can display in the Actions menu or the action bar.

Sending replies to a mail memo

To create an automatic reply to a mailed document, create an agent, event, form or view action, hotspot, or button that uses the simple action "Reply to Sender."