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: PL/SQL for e-mail

Re: PL/SQL for e-mail

From: Menno Jonkers <menno_at_sp-am-tryllian.com>
Date: 2000/05/04
Message-ID: <i7pre8.d3p.ln@litas.intra.tryllian.net>#1/1

Hi,

For sending an email from PL/SQL in Oracle 8i you may want to look at the standard package UTL_SMTP. See it's description in Oracle8i Supplied PL/SQL Packages Reference, Release 2 (8.1.6), A76936-01.

See below for an example of its use (cited from the Reference manual). I haven't used it myself though.

Regards,

Menno

Example

The following code example illustrates how the SMTP package might be used by an application to send email. The application connects to an SMTP server at port 25 and sends a simple text message.

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 Received on Thu May 04 2000 - 00:00:00 CDT

Original text of this message

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