| contents | queries | |
| configuration | templates | |
| expressions | sessions | |
| databases | data entry | |
| passwords | ||
| license | support |
baserunner can be used to send email. Creating an email message in baserunner is much the same as any other baserunner function. Messages are created from templates that use the same format as all other baserunner templates.
Windows only: Messages may be created either as plain text or as HTML. With mail templates, unlike other templates, the extension you give the file matters. To create a message in HTML format, the template must have an .htm extension. Any other extension will create a message in plain text format.
baserunner's first mail function allows you to send a message whenever a record is entered or edited. To use these functions, you need to supply either of the variables _mailonentry or _mailonedit. Each of these variables take the name of the mail template as a value.
The second mail function may be used by sending mail as the action to baserunner from the command line or from a form. For a mail action, the mail template is specified with the _mailtarget variable. If no _mailtarget variable is supplied, the current template will be used. On completion, the user is sent either the template specified in _mailpass or _mailfail (or to the template that called the mail function if no pass/fail variables are included).
The mail functions rely on the following variables. These may be contained in the application configuration file or they may be sent through a form.
The Windows version of baserunner uses an internal SMTP routine to send email. The Linux version uses sendmail. The Linux version does not support HTML formatted email: all email sent by the Linux version will be plain text.
| Variable | Value | Description |
|---|---|---|
| _mailhost | Text | Windows: This variable sets the name of the SMTP mail host. The value should be the
name of the SMTP host baserunner should connect to to send the mail, i.e., mail.myhost.com.
This variable is required for all mail functions. Linux: This variable point to the host's sendmail program. The default value of _mailhost under Linux is /usr/sbin/sendmail. If that path is correct, there is no need to set this variable. Otherwise, set _mailhost to the actual path to sendmail. |
| _mailto | Text | This variable sets the address(es) to which the message is sent. The value needs to be a valid email address. You may also supply a comma delimited list of addresses. This variable is required for all mail functions. |
| _mailfrom | Text | This variable sets the return address for an e-mail message. The value needs to be a valid email address. This variable is required for all mail functions. |
| _mailsubject | Text | This variable sets the subject line of an e-mail message. If this variable is omitted, the default subject is "No Subject." |
| _mailcc | Text | This variable sets the address(es) that the mail will be carbon copied to. The value may be a single email address or may be a comma-delimited list of addresses. |
| _mailbcc | Text | This variable sets the address(es) that the mail will be blind carbon copied to. The value may be a single email address or may be a comma-delimited list of addresses. The recipients in the To and CC fields will no see the addresses in the BCC field. |
| _mailtarget | File name | Windows: This variable sets the target template that the mail function will use to
generate the message. If the template has an .htm extension, the message will be sent in
HTML format; otherwise, the message will be sent as plain text. Linux: This variable sets the target template that the mail function will use to generate the message. All messages sent with the Linux version will be sent as plain text. If this variable is omitted when using the mail action, the current template will be used for the mail message. |
| _mailonentry | File name | This variable takes a template name as a value. If included, an email message will be sent each time a record is entered. The rules for this template are the same as _mailtarget, above. |
| _mailonedit | File name | This variable takes a template name as a value. If included, an email message will be sent each time a record is edited. The rules for this template are the same as _mailtarget, above. |
The baserunner license specifically forbids the use of these functions to send any form of SPAM or any unsolicited commercial e-mail. Any such use, will result, at least, in the immediate revocation of the license.
|