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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Mail

Re: Oracle Mail

From: Chris <christianboivin1_at_hotmail.com>
Date: 4 Dec 2001 13:07:27 -0800
Message-ID: <da20daf0.0112041307.738b7409@posting.google.com>


I Michael

I'm using oracle's ult_smtp package
in 1 app for the last 3 month and it work fine but did not use the
file attachment and i'm not sure
if this part work fine.

if you want to try it
here is the wrapper i use
because the example from Oracle
not work properly

hth

Chris

PROCEDURE send_mail (

   sender      IN   VARCHAR2,
   recipient   IN   VARCHAR2,
   subject     IN   VARCHAR2,
   message     IN   VARCHAR2

)
/****************************************************************
* Christian Boivin 2001/07/01
* Procedure qui permet d'envoyer un e-mail par l'intermediaire
* du package utl_smtp
* noter que si le serveur smtp change de nom, il
* faudra changer la constant mail_server pour lui assigner le bon nom
*****************************************************************/
IS
   c             utl_smtp.connection;
   mesg          VARCHAR2 (4000);
   mail_server   VARCHAR2 (25)       := 'mail.domain.com';
   crlf          VARCHAR2 (2)        :=    CHR (13)
                                        || CHR (10);
BEGIN
   c := utl_smtp.open_connection (mail_server, 25);
   utl_smtp.helo (c, mail_server);
   utl_smtp.mail (c, sender);
   utl_smtp.rcpt (c, recipient);
   mesg :=    'Date: '

|| TO_CHAR (SYSDATE, 'dd Mon yy hh24:mi:ss');
mesg := mesg
|| crlf;
mesg := mesg
|| 'From: '
|| sender
|| ' <'
|| sender
|| '>';
mesg := mesg
|| crlf;
mesg := mesg
|| 'To: '
|| recipient
|| ' <'
|| recipient
|| '>';
mesg := mesg
|| crlf;
mesg := mesg
|| 'Subject: '
|| subject;
mesg := mesg
|| crlf;
mesg := mesg
|| ''
|| crlf
|| message;

   utl_smtp.data (c, mesg);
   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 send_mail;

mjohnson_7_at_yahoo.com (Michael) wrote in message news:<1aa764e5.0111281309.3970166d_at_posting.google.com>...

> Does anyone use Oracle email?
> 
> If so what is you experience/opinion of it?
> 
> Thanks,
> 
> Michael
Received on Tue Dec 04 2001 - 15:07:27 CST

Original text of this message

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