Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: generate and send an e-mail message from PL/SQL bloc

Re: generate and send an e-mail message from PL/SQL bloc

From: <jeanch_at_my-deja.com>
Date: 2000/06/08
Message-ID: <8hnmcq$hf8$1@nnrp1.deja.com>#1/1

In article <xdz%4.17607$Gh.196852_at_typhoon.austin.rr.com>,   "Bill" <brinderknecht_at_austin.rr.com> wrote:
> I have heard that 8.1.6 supports e-mail, can anyone tell me how to
 access
> this functionality using PL/SQL?
>
>

o create you package as usual...
o add this method to your API
 --send e_mail from PL/SQL
 PROCEDURE send_mail (sender IN VARCHAR2,

                     recipient IN VARCHAR2,
                     message  IN VARCHAR2)
 IS

    mailhost VARCHAR2(30) := 'mailhost.mydomain.com';      mail_conn utl_smtp.connection;

 BEGIN

     mail_conn := utl_smtp.open_connection(mailhost, 25);
     utl_smtp.helo(mail_conn, mailhost);
     utl_smtp.mail(mail_conn, sender);
     utl_smtp.rcpt(mail_conn, recipient);
     utl_smtp.data(mail_conn, message);
     utl_smtp.quit(mail_conn);
 EXCEPTION
     WHEN OTHERS THEN
 		dbms_output.put_line(substr(sqlerrm,1,200));
         -- Handle the error

 END send_mail;

o then
begin
yourpkg.send_mail('scott_at_domain.com','tiger_at_domain.com','check this out');
end;

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Jun 08 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US