25.8 SEND Function
This function returns a mail id after adding the mail to the mail queue of Application Express. The mail id can be used in a call to add_attachment to add attachments to an existing mail. 
                  
The mail is based on an e-mail template where the placeholder values specified as json string are substituted.
Syntax
FUNCTION SEND (
    P_TEMPLATE_STATIC_ID IN VARCHAR2,
    P_PLACEHOLDERS       IN CLOB,
    P_TO                 IN VARCHAR2,
    P_CC                 IN VARCHAR2 DEFAULT NULL,
    P_BCC                IN VARCHAR2 DEFAULT NULL,
    P_FROM               IN VARCHAR2 DEFAULT NULL,
    P_REPLYTO            IN VARCHAR2 DEFAULT NULL,
    P_APPLICATION_ID     IN NUMBER   DEFAULT wwv_flow_security.g_flow_id )
    RETURN NUMBER;Parameters
Table 25-5 SEND Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Static identifier string, used to identify the shared component email template. | 
| 
 | JSON string representing the placeholder names along with the values, to be substituted. | 
| 
 | Valid email address to which the email is sent (required). For multiple email addresses, use a comma-separated list. | 
| 
 | Valid email addresses to which the email is copied. For multiple email addresses, use a comma-separated list. | 
| 
 | Valid email addresses to which the email is blind copied. For multiple email addresses, use a comma-separated list. | 
| 
 | Email address from which the email is sent (required). This email address must be a valid address. Otherwise, the message is not sent. | 
| 
 | Address of the Reply-To mail header. You can use this parameter as follows: 
 | 
| 
 | Application ID where the email template is defined. Defaults to the current application (if called from within an application). | 
Examples
declare
    l_mail_id number;
begin
    l_mail_id := apex_mail.send (
                      p_template_static_id => 'ORDER',
                      p_placeholders       => '{ "ORDER_NUMBER": 5321, "ORDER_DATE": "01-Feb-2018", "ORDER_TOTAL": "$12,000" }',
                      p_to                 => 'some_user@somewhere.com' );
    apex_mail.add_attachment (
        p_mail_id    => l_mail_id,
        p_attachment => ... );
end;Parent topic: APEX_MAIL