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

Home -> Community -> Mailing Lists -> Oracle-L -> UTL_SMTP

UTL_SMTP

From: Herman Cungadibrata <herman.aa_at_acc.co.id>
Date: Wed, 04 Jul 2001 03:00:03 -0700
Message-ID: <F001.00340F91.20010704030032@fatcity.com>


Hi Gurus,
I am trying to used UTL_SMTP to send an e-mail form my oracle machine. I tried the sample code from oracle documentation. PROCEDURE

send_mail (sender    IN VARCHAR2,
                                       recipient IN VARCHAR2,
                                       message   IN VARCHAR2)
as
    mailhost    VARCHAR2(30) := 'mail.somewhere.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

        dbms_output.put_line('error');
        -- Handle the error
END;
and i call the procedure from sqlplus

begin
send_mail('aaa_at_somewhere.com','me_at_somewhere.com','test from oracle'); end;

and i receive the e-mail like this

Return-Path: <aaa_at_somewhere.com>
Delivered-To: me_at_somewhere.com
Received: (qmail 3139 invoked from network); 4 Jul 2001 09:58:00 -0000 Received: from oracle.somewhere.com (HELO mail.somewhere.com) (192.169.0.25) by mail.somewhere.com with SMTP; 4 Jul 2001 09:58:01 -0000 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) test form oracle

the problem is i lost the sender ( it sould be aaa_at_somewhere.com) and the title (i don't know where i must put the title). Regards,
Herman Received on Wed Jul 04 2001 - 05:00:03 CDT

Original text of this message

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