Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: generate and send an e-mail message from PL/SQL bloc
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
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
![]() |
![]() |