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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Off-Topic: How to send email from PL/SQL

RE: Off-Topic: How to send email from PL/SQL

From: CHAN Chor Ling Catherine (CSC) <clchan_at_nie.edu.sg>
Date: Thu, 14 Dec 2000 18:33:29 +0800
Message-Id: <10710.124546@fatcity.com>


Hi Arun,

The PL/SQL code is below. It does not seem to be able to cc email.

Qn : Has anyone successfully sent and cc emails in PL/SQL ? Please help. Thanks.

Regds,
Chorling

DECLARE                                                                   
       c utl_smtp.connection;

 

       PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS

       BEGIN

         utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);

       END;

 

     BEGIN

       c := utl_smtp.open_connection('smtp-server.acme.com');      -- your
smtp server            
       utl_smtp.helo(c, 'foo.com');         -- your domain

       utl_smtp.mail(c, 'sender_at_foo.com');

       utl_smtp.rcpt(c, 'recipient_at_foo.com');

       utl_smtp.open_data(c);

       send_header('From',    '"Sender" <sender_at_foo.com>');

       send_header('To',      '"Recipient" <recipient_at_foo.com>');

       send_header('Subject', 'Hello');

       utl_smtp.write_data(c, utl_tcp.CRLF || 'Hello, world!');

       utl_smtp.close_data(c);

      utl_smtp.quit(c);

    EXCEPTION        WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN

         utl_smtp.quit(c);

         raise_application_error(-20000,

           'Failed to send mail due to the following error: ' || sqlerrm);

     END;   

		-----Original Message-----
		From:	arun_at_ssind.stpn.soft.net
[mailto:arun_at_ssind.stpn.soft.net]
		Sent:	Thursday, December 14, 2000 6:11 PM

		Hi,

		Can you send the details how you implemented this.

		Thanks and Regards
		Arun

		----- Original Message -----
		From: "CHAN Chor Ling Catherine (CSC)" <    >
		To: "Multiple recipients of list ORACLE-L"
<ORACLE-L_at_fatcity.com>
		Sent: Thursday, 14 December, 2000 01:31 PM
		Subject: Re: Off-Topic: How to send email from PL/SQL



> Hi
>
> I've tried using the package utl_smtp. It works.
>
> Regds,
> ChorLing
> -----Original Message-----
> From: CHAN Chor Ling Catherine (CSC)
> Sent: Thursday, December 14, 2000 3:26 PM
> To: 'ORACLE-L_at_fatcity.com'
> Subject: Off-Topic: How to send email from PL/SQL
>
> Hi,
>
> Is it possible to send email in PL/SQL ? Is there any
Oracle function that
> send email in PL/SQL ? If not, I guess I've to write the
email information
> into a table, use a C-program to extract the information
in the table and
> email it to the sender. Any advice ? Thanks in advance.
>
> Regds,
> Chorling
> --
> Please see the official ORACLE-L FAQ:
http://www.orafaq.com
> --
> Author: CHAN Chor Ling Catherine (CSC)
> INET: clchan_at_nie.edu.sg
>
> Fat City Network Services -- (858) 538-5051 FAX: (858)
538-5051
> San Diego, California -- Public Internet access /
Mailing Lists
>
--------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail
message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
'ListGuru') and in
> the message BODY, include a line containing: UNSUB
ORACLE-L
> (or the name of mailing list you want to be removed from).
Received on Thu Dec 14 2000 - 04:33:29 CST

Original text of this message

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