If an email includes a link to an Application Express instance, use this function to get the instance URL.
Note:
This function requires that the instance setting Application Express Instance URL
for emails is set.
Syntax
APEX_MAIL.GET_INSTANCE_URL return VARCHAR2;
Parameters
None.
Example
The following example sends an Order Confirmation email which includes an absolute URL to page 10 of application 100.
declare l_body clob; l_body_html clob; begin l_body := 'To view the content of this message, please use an HTML enabled mail client.' || utl_tcp.crlf; l_body_html := '<html><body>' || utl_tcp.crlf || '<p>Please confirm your order on the <a href="' || apex_mail.get_instance_url || 'f?p=100:10">Order Confirmation</a> page.</p>' || utl_tcp.crlf || '</body></html>'; apex_mail.send ( p_to => 'some_user@somewhere.com', -- change to your email address p_from => 'some_sender@somewhere.com', -- change to a real senders email address p_body => l_body, p_body_html => l_body_html, p_subj => 'Order Confirmation' ); end;