0% found this document useful (0 votes)
747 views2 pages

Apex Mail To Send A e Mail HTML Format Link in Apex

This document discusses how to send emails from an Oracle Application Express (APEX) application using the APEX_MAIL package. It provides steps to send plain text and HTML formatted emails, including declaring variables, calling the APEX_MAIL.SEND procedure, and specifying the to/from addresses, subject, and body of the email. The APEX_MAIL package makes it easy to send emails programmatically from APEX applications.

Uploaded by

anjireddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
747 views2 pages

Apex Mail To Send A e Mail HTML Format Link in Apex

This document discusses how to send emails from an Oracle Application Express (APEX) application using the APEX_MAIL package. It provides steps to send plain text and HTML formatted emails, including declaring variables, calling the APEX_MAIL.SEND procedure, and specifying the to/from addresses, subject, and body of the email. The APEX_MAIL package makes it easy to send emails programmatically from APEX applications.

Uploaded by

anjireddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

APEX_MAIL To Send a E-Mail & HTML Format link In APEX

Today i am going to write a blog about sending email and HTML support message in Oracle Application Express (APEX). In APEX 5, Sending a e-mail feature is
made it as very easily. Let's go through the below steps will step by step help your sending emails (APEX_MAIL) to public user.

How APEX_MAIL Will Help ?

In Oracle Application Express will make life easily to send mail to user by you can use the APEX_MAIL package to send an email from an APEX. This package is
built on top of the Oracle supplied UTL_SMTP package. By default this dependence, the UTL_SMTP package already be installed and functioning in APEX in
order to that you can use APEX_MAIL option to send mail by simply.

In Oracle Application Express, APEX_MAIL contains three procedures.

Use APEX_MAIL.SEND to send an outbound email message from your application.


Use APEX_MAIL.PUSH_QUEUE to deliver mail messages stored in APEX_MAIL_QUEUE.
Use APEX_MAIL.ADD_ATTACHMENT to send an outbound email message from your application as an attachment.

Sending E-Mail In APEX:

Create a one page in APEX (My case : page no is '5') and add button in this page (my case : named as p5_Send_Mail). The following steps will help your for send
a plain text email message from an application.

To create a PL/SQL procedure to send a e-mail to the your public user:

1. Navigate to page, my cases page no is "5"


2. Left side of the Page Processing area under Processes, click Create.
3. In the Create Process Wizard:
o Enter Name for the processes and my cases "p5_Send_mail".
o From the Point list, select On Submit - After Computations and Validations.
o From the Type list, select PL/SQL block, copy and paste the below code inside this block,

DECLARE
l_id number;
BEGIN
l_id := APEX_MAIL.SEND(
p_to => '[email protected]',
p_from => '[email protected]',
p_subj => 'Type your subject of the mail',
p_body => 'Type body od the message');
END;
4. In the Success Message field, enter: Mail Sent Successfully.
5. In the Failure Message field, enter: Error Sending Mail.
6. From the When Button Pressed list, select your button name (In my case: p5_Send_Mail). This is the send mail button that Placed in your page for processes
conditional.
7. Make Save Option and Run your Application.
You should now receive mail from this application and check your e-mail by 2 mins later or sometimes mail receive in Spam.

Sending E-Mail In HTML Format:

The following steps will help your for send a HTML format of email message from an application.

To create a PL/SQL procedure to send a HTML e-mail to the your public user:

1. Navigate to page, my cases page no is "5"


2. Left side of the Page Processing area under Processes, click Create.
3. In the Create Process Wizard:
o Enter Name for the processes and my cases "p5_Send_mail".
o From the Point list, select On Submit - After Computations and Validations.
o From the Type list, select PL/SQL block, copy and paste the below code inside this block,

DECLARE
l_id number;
l_body varchar2(1000);
l_from varchar2(50);
l_subject varchar2(100);
v_body_temp varchar2(10000);
BEGIN
l_from:='[email protected]';
l_subject:='Confirm your Availability for your Online Exam';
l_body := 'Reports.'||utl_tcp.crlf;
v_body_temp := '
<html>
<body>
<p>
Hi,<br>Click the below link to Confirm your Readiness for the Online Exam..!<br>
<a href="https://apex.oracle.com/pls/apex/f?p=27267:20">Click here to Confirm<a><br><b>Regards</b><br>
Exam Center.
</p>
</body>
</html>';
l_id := APEX_MAIL.SEND(
p_to => '[email protected]',
p_from => l_from,
p_body => l_body,
p_body_html => v_body_temp,
p_subj => l_subject);
END;

4. In the Success Message field, enter: Mail Sent Successfully.


5. In the Failure Message field, enter: Error Sending Mail.
6. From the When Button Pressed list, select your button name (In my case: p5_Send_Mail). This is the send mail button that Placed in your page for
processes conditional.
7. Make Save Option and Run your Application.
You should now receive mail from this application and check your e-mail by 2 mins later or sometimes mail receive in Spam.

If you like this Blog and feel my guides useful, please share my page. Thanks! Cheers!

You might also like