Send Email to Database (DBMAIL)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Send Email to Database (DBMAIL) command sends an HTML or plain text email to the the email address found in the specified database file. The EMAIL field is identified along with the optional Query String (SQL WHERE clause). The query string is used to subset the records in the file that are sent the email message. The email must be stored in a text file on the IFS (currently) and will be sent to each receipient.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FROM Sent from email address Character value Required, Positional 1
STMF IFS Streamfile Path name Required, Positional 2
SUBJECT Email Subject Character value, *BLANK Required, Positional 3
FILE Database file Qualified object name Required, Positional 4
Qualifier 1: Database file Name
Qualifier 2: Library Name
EMAIL Email field name Name, EMAIL Optional, Positional 5
WHERE SQL Where (selection) clause Character value Optional, Positional 6
ORDERBY SQL Order by Character value Optional, Positional 7
Top
Top

Email Body (HTML document) (STMF)

Specify the fully qualified IFS file name that is going to be sent as an EMAIL to the list of email addresses. This file may contain full HTML or it can be plain ASCII text.

This is a required parameter.

path-name
Specify the IFS path name of email file.
Top

Email Subject (SUBJECT)

Specify the subject line for the email.

This is a required parameter.

character-value
Specify up to 80 characters for the email subject line.
Top

Database file (FILE)

Specify the database file that contains email addresses. any Externally Described Database file may be used.

This is a required parameter.

Database file

name
Top

Email field name (EMAIL)

Specify the name of the field in the database file that contains the email address. This field is extracted from the file and an email is sent to the email address in the field.

EMAIL
The default field name is "EMAIL" but any field name may be specified.
name
Specify any field name in the database file. This field should contain a valid email address.
Top

SQL Where Clause (WHERE)

Specify an SQL WHERE clause to be used to subset the records being selected. Only records that match this WHERE clause shall be included. DO NOT INCLUDE THE SQL KEYWORD "WHERE" on this parameter. Up to 1024 characters may be specified for this parameter.

SQL WHERE value
Specify any valid WHERE clause, such as:

WHERE('state in (''IL'',''IN'',''IA'') and status =''A''')

Top

SQL Order By (ORDERBY)

Specify an SQL ORDER BY clause to sequence the data being selected. DO NOT INCLUDE THE SQL KEYWORD "ORDER BY" on this parameter. Up to 1024 characters may be specified for the ORDER By parameter. Each field in the "key sequence" must be separated by a comma.

SQL ORDER By value
Any valid ORDER By syntax is supported:

ORDERBY('country,Company,orddate desc')

Top

Examples

None
Top

Error messages

Unknown
Top