Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

   
 

ss

Oracle Tips by Burleson 

Creating a Form for Email

Not only will this section show a simple form for emailing, but it will also introduce the HTMLDB_MAIL package.  The HTMLDB_MAIL package is used by the developer to send email from within HTML DB.

For information on setting up Email, refer to Chapter 15 – HTML DB Administration II.

In the following example, it will be necessary to build a new page with page ID 1080.  The page created by the author is shown in Figure 8.19 and is included in the EASY Sample application in the code depot.  Building pages, buttons, and page items have already been introduced, so those steps will not be repeated here.  Since many text messages are limited to maximum length, the text area was limited to 160 characters.

The data in the select list is populated from a table named EASY_PERSON.  The table contains a column with an email address that can be used to send text messages to a person’s cell phone.

To send the text message, an After Submit page process will be created that executes on the condition when the Send Message button is pressed.  The code used for the email process is shown in file ch8_1.sql contained in the code depot.

The HTMLDB_MAIL.SEND procedure can send text of data type VARCHAR2 or CLOB; however, the limit for the length of any single line is 1000 characters.  After the 1000 character limit, a new line must be included before continuing the email message.

The person’s pager address is being selected and used in the p_to parameter of the send procedure.  The message body is taken from the P1080_MSGTEXT page item.

Also, take notice of the use of htmldb_mail.push_queue procedure.  Email in HTML DB is placed into a message queue and processed every ten minutes.  However, since text messages can sometimes be urgent, such as a production database issue, the htmldb_mail_push_queue procedure has been used to force the email queue to send all messages immediately.

 declare
   s_pager easy_person.pager%type;
begin
   select
      pager
   into
      s_pager
   from
      easy_person
   where  id = :P1080_ID;

   htmldb_mail.send
(
      p_to => s_pager,
      p_from => 'easyhtmldb@rampant.cc',
      p_body => :P1080_TEXTMSG,
      p_subj => 'HTML DB Email' );
   htmldb_mail.push_queue( 'localhost', 25 );
end;


The above book excerpt is from:

Easy HTML-DB Oracle Application Express

Create Dynamic Web Pages with OAE

ISBN 0-9761573-1-4   

Michael Cunningham & Kent Crotty

http://www.rampant-books.com/book_2005_2_html_db.htm

 

Download your Oracle scripts now:

www.oracle-script.com

The definitive Oracle Script collection for every Oracle professional DBA

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   

 

   

 Copyright © 1996 -2017 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks