Friday, April 24, 2015

Sending email from APEX using APEX_MAIL

To send an email using APEX you can use APEX_MAIL.SEND and APEX_MAIL.PUSH_QUEUE apis

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.' ;
    l_body_html := '<html><body><p> This is test email </p> </body></html>';
    APEX_MAIL.SEND (
        p_to        => 'fromemail@email.com',   -- change to your email address
        p_from      => 'toemail@email.com', -- change to a real senders email address
        p_body      => l_body,
        p_body_html => l_body_html,
        p_subj      => 'My subject' );

    APEX_MAIL.PUSH_QUEUE;


end;



2 comments:

Raj Thakkar said...

Love it! Thank you so much for sharing this one really well defined all peaceful info,well really like it. Thank you so much for sharing this one. - SQL Lite Database Integration Service

Sanjeev Chauhan said...

You are welcome, Raj.