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

Home -> Community -> Mailing Lists -> Oracle-L -> How to send/receive email through pl/sql ??

How to send/receive email through pl/sql ??

From: Janet Linsy <janetlinsy_at_yahoo.com>
Date: Tue, 11 Feb 2003 10:22:29 -0800
Message-ID: <F001.00549B2D.20030211102229@fatcity.com>


Hi, I have the following code. it compiles fine and runs successfully. But when I checked email in b_at_yahoo.com, I didn't get any mail. I'm testing on the same machine (win2000, 817). Anybody knows why? Thank you in advance.

create or replace PROCEDURE send_test_message IS

    mailhost    VARCHAR2(64) := 'localhost';
    sender      VARCHAR2(64) := 'a_at_yahoo.com';
    recipient   VARCHAR2(64) := 'b_at_yahoo.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);

-- If we had the message in a single string, we could
collapse
-- open_data(), write_data(), and close_data() into a
single call to data().

    utl_smtp.open_data(mail_conn);
    utl_smtp.write_data(mail_conn, 'This is a test message.' || chr(13));

    utl_smtp.write_data(mail_conn, 'This is line 2.' || chr(13));

    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    EXCEPTION

        WHEN OTHERS THEN
           -- Insert error-handling code here
           NULL;

END;
/

Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com
--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Janet Linsy
  INET: janetlinsy_at_yahoo.com
Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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). You may also send the HELP command for other information (like subscribing). Received on Tue Feb 11 2003 - 12:22:29 CST

Original text of this message

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