- Goal
APEX_MAILを使ってPROCEDUREからEmailを送る
(もちろんUTL_SMTPでも送れるが、APEX_MAILの方が簡単)
想定される場面は、Batchでお知らせメールを配信したい場合など - How
以下の1行を追加する
wwv_flow_api.set_security_group_id;
アプリケーション内から送信する場合は不要 - Source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace procedure "APEX_MAIL_IN_PROCEDURE" | |
is | |
l_to VARCHAR2(100) :='<test_email_address>'; | |
l_from VARCHAR2(100) :='<test_email_address>'; | |
l_cc VARCHAR2(100); | |
l_body VARCHAR2(2000) :='test'; | |
l_body_html VARCHAR2(4000); | |
l_subj VARCHAR2(300) :='test'; | |
BEGIN | |
-- | |
--Need to add this line. | |
wwv_flow_api.set_security_group_id; | |
-- | |
-- | |
apex_mail.send (p_to => l_to, | |
p_from => l_from, | |
p_cc => l_cc, | |
p_body => l_body, | |
p_body_html => l_body_html, | |
p_subj => l_subj); | |
END; |
0 件のコメント:
コメントを投稿