Results 1 to 5 of 5

Thread: Auto mail.

  1. #1
    Join Date
    Jul 2004
    Posts
    102

    Unanswered: Auto mail.

    Hi all,

    Is that possible ? automatic mail to mentioned mail ID from oracle 9i.

    Thanks.
    Working Together...

  2. #2
    Join Date
    May 2004
    Location
    Germany
    Posts
    25
    Hi,

    on the 9i server you have to handle mail functionality with the utl_smtp package (http://download-west.oracle.com/docs...tp.htm#1000695) or with tools outside the database (e.g. sendmail).

    On oracle 10g you have mail functionality out of the box (e.g administration purposes).

  3. #3
    Join Date
    Jul 2004
    Posts
    102
    Many many thanks.

    Would you please help me providing setp to step procedure to implement this.

    Please................
    Working Together...

  4. #4
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    just do a google search on utl_smtp. There's some example procedures on ask tom aswell

    http://asktom.oracle.com/pls/ask/f?p...:1739411218448

  5. #5
    Join Date
    May 2004
    Location
    Germany
    Posts
    25
    No, just read the link above. If you do not have an otn account, just create one. It is for free, just supply an email address.

    Read the example at http://download-west.oracle.com/docs...p3.htm#1005700

    Oracle Documentation / Supplied PL/SQL Packages

    Example

    The following example illustrates how UTL_SMTP is used by an application to send e-mail. The application connects to an SMTP server at port 25 and sends a simple text message.

    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');
    utl_smtp.helo(c, 'foo.com');
    utl_smtp.mail(c, 'sender@foo.com');
    utl_smtp.rcpt(c, 'recipient@foo.com');
    utl_smtp.open_data(c);
    send_header('From', '"Sender" <sender@foo.com>');
    send_header('To', '"Recipient" <recipient@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
    BEGIN
    utl_smtp.quit(c);
    EXCEPTION
    WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
    NULL; -- When the SMTP server is down or unavailable, we don't have
    -- a connection to the server. The quit call will raise an
    -- exception that we can ignore.
    END;
    raise_application_error(-20000,
    'Failed to send mail due to the following error: ' || sqlerrm);
    END;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •