Generate Email Using Formula Language
There are
How It WorksThe @Command([Mailsend]) command generates an email based on the current document. This statement is typically added to an action button on a form. This approach also requires the form to include a field called SendTo. This field must contain a valid list of one or more email addresses. Optionally, the form can also include Subject, CopyTo, and BlindCopyTo fields.
The
@MailSend
function sends a custom email message based on function call parameters instead of using field values on the document. With this approach, the email is generated by specifying the list of recipients, subject, and body information within the function. When executed, the function sends a message to all recipients listed in the SendTo, CopyTo, and BlindCopyTo fields. Like its
Tip You may want to save and close the document after either button is pressed. This is achieved by appending @Command([FileSave]) to save the document and @Command([FileCloseWindow]) to close the document. ImplementationExample 1To implement the @Command([Mailsend]) approach, create a form that includes the SendTo and Subject fields. Next, create an action button and insert the following formula in the Programmer's pane. When clicked, the @Mailsend statement retrieves the field values from the document and sends the email message to the recipient list.
@Command ([MailSend]) ImplementationExample 2To implement the @MailSend approach, create an action button and insert the following formula. Be sure to adjust the SendTo value to reflect all intended email recipients as well as the subject line.
SendTo := @UserName; CopyTo := ""; BlindCopyTo := ""; Subject := "This is a sample email"; Remark := ""; BodyFields := "This is the body of the email."; Flags := ""; @MailSend(sendTo ; copyTo ; blindCopyTo ; subject ; remark ; bodyFields ; Flags); @Prompt([Ok]; "Success"; "Message sent."); |
How to
|

Mastering XPages: A Step-by-Step Guide to XPages Application Development and the XSP Language

XPages Extension Library: A Step-by-Step Guide to the Next Generation of XPages Components

Survival Guide for Lotus Notes and Domino Administrators

IBM Lotus Domino: Classic Web Application Development Techniques