Simple Email 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 := '' || utl_tcp.crlf || '

Please confirm your order on the Order Confirmation page.

' || utl_tcp.crlf || ''; apex_mail.send ( p_to => 'adam.grant@oracle.com', -- change to your email address p_from => 'adam.grant@oracle.com', -- change to a real senders email address p_body => l_body, p_body_html => l_body_html, p_subj => 'Order Confirmation' ); end; --------------------------------------------------------------------------------------------------------------------------- Code from M&A System DECLARE l_id NUMBER; l_body CLOB; l_body_html CLOB; file_name VARCHAR(255); legal_entity VARCHAR(255); document BLOB; filename VARCHAR(400); mimetype VARCHAR(255); username VARCHAR(255); description VARCHAR(1000); need_by DATE; years VARCHAR(255); country VARCHAR(255); comments VARCHAR(1000); requesting_org VARCHAR(255); acquisition_id NUMBER; acquisition VARCHAR(255); record_id NUMBER; subject VARCHAR(255); RequestType VARCHAR(255); FiscalQuarter VARCHAR(255); FiscalYear VARCHAR(255); Priority VARCHAR(255); Litigation VARCHAR(255); Audited VARCHAR(255); Month VARCHAR(255); Year VARCHAR(255); MONTH_IN_NUMBER NUMBER; QUARTER_IN_NUMBER NUMBER; COMMON_QUARTER VARCHAR(100); BEGIN l_body := 'To view the content of this message, please use an HTML enabled mail client.'||utl_tcp.crlf; username := :P74_USERNAME; legal_entity := :P74_LEGAL_ENTITY; description := :P74_ADDRESS; need_by := :P74_NEED_BY; years := :P74_YEARS; country := :P74_COUNTRY; comments := :P74_REQUESTER_COMMENTS; requesting_org := :P74_REQUESTING_ORG; acquisition_id := :P74_ACQUISITION_ID; RequestType := :P74_REQUEST_TYPE; FiscalQuarter := :P74_FISCAL_QUARTER; FiscalYear := :P74_FISCAL_YEAR; Priority := :P74_PRIORITY; Litigation := :P74_LITIGATION; Audited := :P74_AUDIT; Month := :P74_MONTH; Year := :P74_YEAR; MONTH_IN_NUMBER := :P74_MONTH_IN_NO; QUARTER_IN_NUMBER := :P74_QUARTER_IN_NO; COMMON_QUARTER := :P74_COMMON_QUARTER; IF :P74_ATTACHMENT IS NOT NULL THEN select blob_content, filename, mime_type into document, file_name, mimetype from apex_application_temp_files where name = :P74_ATTACHMENT ; ELSE file_name := 'No file attached'; END IF; INSERT INTO RECORDS_REQUESTS ( USERNAME, LEGAL_ENTITY, DESCRIPTION, REQUEST_STATUS, ATTACHMENT, FILENAME, MIMETYPE, NEED_BY, YEARS, COUNTRY, REQUESTER_COMMENTS, REQUESTING_ORG, ACQUISITION_ID, REQUEST_TYPE, FISCAL_QUARTER, FISCAL_YEAR, REQUEST_PRIOIRTY, LITIGATION_STATUS, AUDIT_STATUS, MONTH_OF_YEAR,YEAR, MONTH_IN_NUMBER, QUARTER_IN_NUMBER, COMMON_QUARTER) VALUES ( username, legal_entity, description, 'OPEN', document, file_name, mimetype, need_by, years, country, comments, requesting_org, acquisition_id, RequestType, FiscalQuarter, FiscalYear, Priority, Litigation, Audited, Month, Year, MONTH_IN_NUMBER, QUARTER_IN_NUMBER, COMMON_QUARTER); -- Get ID of the request that was just submitted select "RECORDS_REQUESTS_SEQ".currval into record_id from sys.dual ; -- Get name of the acquisition select ACQUISITION into acquisition from ACQUISITIONS where ID = acquisition_id ; -- Get name of the legal entity if legal_entity is null then legal_entity := 'None'; end if; subject := 'Records Management Request: ' || record_id; l_body_html := '

'||utl_tcp.crlf; l_body_html := l_body_html ||'Requester: '|| username ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Request ID: '|| record_id ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Acquisition: '|| acquisition ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Country: '|| country ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Entity: '|| legal_entity ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Date Range: '|| years ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Need by: '|| need_by ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Description/Keywords: '|| description ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Additional Comments: '|| comments ||'
'||utl_tcp.crlf; l_body_html := l_body_html ||'Organization Requesting Information: '|| requesting_org ||'

'||utl_tcp.crlf; l_body_html := l_body_html ||'Click link to view the status of this request: https://apex.oraclecorp.com/pls/apex/f?p=&APP_ID.:73
'||utl_tcp.crlf; -- l_body_html := l_body_html ||'Need by: '|| need_by ||'

'||utl_tcp.crlf; l_body_html := l_body_html ||'

'||utl_tcp.crlf; l_body_html := l_body_html ||''; l_id := apex_mail.send( p_to => GET_RECORDS_TEAM_EMAIL(), p_from => username, p_body => l_body, p_body_html => l_body_html, p_subj => subject ); IF :P74_ATTACHMENT IS NOT NULL THEN APEX_MAIL.ADD_ATTACHMENT( p_mail_id => l_id, p_attachment => document, p_filename => file_name, p_mime_type => mimetype ); END IF; apex_mail.send( p_to => username, p_from => GET_RECORDS_TEAM_EMAIL(), p_body => l_body, p_body_html => l_body_html, p_subj => subject ); END;