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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored Procedures and Email

Re: Stored Procedures and Email

From: Adam Gent <a.l.gent_at_cs.cf.ac.uk>
Date: Fri, 15 Feb 2002 17:15:55 -0000
Message-Id: <1013793359.9084.0@iapetus.uk.clara.net>


Hi,

Thanks for your reply.

It appears that utl_smtp is installed and the version of oracle is Jserver release 8.1.6.0.0

The code is (from the oracle docs)
PROCEDURE send_mail (sender IN VARCHAR2, recipient IN VARCHAR2, message IN VARCHAR2) IS

    mailhost VARCHAR2(30) := 'sentinel.cs.cf.ac.uk';     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);

END; And the error is when I try to create the procedure is:

PLS-00201: identifier 'MAIL_CONN' must be declared

If you could be of any help I would be greateful.

Thanks,

Adam Gent

"damorgan" <dan.morgan_at_ci.seattle.wa.us> wrote in message news:3C6D401D.3FB6E56D_at_ci.seattle.wa.us...
> No. Though since you didn't bother to include the version of Oracle you
are
> using that is a possibility. Do they charge you more to provide
information when
> you ask questions?
>
> Here's what you need to do:
> 1. At the SQL*Plus SQL> prompt type DESC UTL_SMTP
> 2. If it is there you will know it. If not ... then it may isn't in your
> version.
> 3. If 2 is negative ask the DBA to log on as SYS and check. If they find
it
> they should
> execute the following:
> GRANT EXECUTE ON UTL_SMTP TO <your schema name here>;
> 4. If you have it and have rights granted to use it ... you may not have
access
> to the mail server.
> 5. Or you may just have written bad code. Since you didn't bother to post
the
> ORA error
> message ... or your code ... who can say?
>
> Daniel Morgan
>
>
>
>
> Adam Gent wrote:
>
> > Hi,
> >
> > I have tried that but keep getting an error message when I try to run a
test
> > script from the oracle docs.
> >
> > The error I get is that mail_conn is not declared but it is declared as
> > mail_conn utl_smtp.connection;
> >
> > Does this mean the utl_stmp it not installed on the oracle server.
> >
> > Thanks,
> >
> > Adam Gent
> >
> > "Yann CAUCHARD" <yann.cauchard_at_spcconsultants.com> wrote in message
> > news:a4jctv$1qqv$1_at_news6.isdnet.net...
> > > Just have a look to package UTL_SMTP.
> > >
> > > Yann
> > >
> > > Adam Gent a écrit dans le message
> > > <1013787834.30041.0_at_iapetus.uk.clara.net>...
> > > >Hi,
> > > >
> > > >Is there anyway to send emails from within oracle stored procedures.
> > > >
> > > >Thanks,
> > > >
> > > >Adam Gent
> > > >a.l.gent_at_cs.cf.ac.uk
> > > >
> > > >
> > >
> > >
>
Received on Fri Feb 15 2002 - 11:15:55 CST

Original text of this message

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