EM_ADD_DELIVERY_DETAILS Function

Purpose

Adds the delivery details to the started email, including the email addresses of the sender and at least one recipient. If a predefined delivery configuration item is specified the details are loaded from that item; these details can be overridden by providing additional configuration parameters.

Returns TRUE or FALSE.

Syntax

EM_ADD_DELIVERY_DETAILS([delivery-item || delivery-configuration])

Syntax elements

delivery-item The item ID of a predefined delivery configuration item from an email configuration file (either the default EM_CONFIG file or a file previously specified by the EM_DEFINE_CONFIG function).

delivery-configuration A dynamic array of the parameters defining the delivery information for the email, as shown in the table below.

Each email address can optionally include the name of the sender or recipient (as appropriate) to be displayed by the receiving client. This display name can be omitted, in which case the email address does not need to be enclosed in the angled brackets (<>). Valid examples include:

  • User Name <username@example.com>

  • <username@example.com>

  • username@example.com

Attribute

Name

Description

1

DESC

An optional description of the configuration used or the name of the entry stored in the configuration file if no other attributes are passed.

2

SUBJECT

The text to appear as the emails subject.

3

TO

An optional value-mark delimited list of name and email addresses of the recipients. Although TO, CC and BCC are all optional, at least one must be defined.

4

FROM

The name and email address of the sender.

5

CC

An optional value-mark delimited list of the names and email address of the recipients to be copied into the email.

6

BCC

An optional value-mark delimited list of the names and email address of the recipients to be blind copied into the email.

Returns

EM_ADD_DELIVERY_DETAILS returns TRUE if successful or FALSE if unsuccessful. If FALSE, the details of the failure to load the configuration can be found by inspecting the error number held in the common variable EM_ERROR_DETAILS.

Comments

You must include the item #EM_INCLUDES in all programs that use the Email API functions; for example, you could add the line

INCLUDE #EM_INCLUDES FROM /SYSFILES/SYS.BASLIB

at the start of the program, or create an item to be automatically included that contains this line.