Results 1 to 3 of 3

Thread: me again

  1. #1
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441

    Unanswered: me again

    hello you lot,

    i am attempting to send an email from my oracle 9 database.

    I searched google and found http://otn.oracle.com/sample_code/te...tp_Sample.html at Oracle. Seemed like a good bet.

    Every time i try to run the script it results in this error
    SP2-0423: Illegal GET command
    which according to this ( http://www.csis.gvsu.edu/GeneralInfo...90842/ch14.htm ) page means
    SP2-0423 Illegal GET command
    Cause: An invalid option was used in the GET command.
    Action: Check the syntax of the command you used for the correct options.
    This makes no sense to me. I am sure this should work, it is afterall from oracle.

    Can anyone else help me with an example?!

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: me again

    This should work for simple emails:

    CREATE OR REPLACE
    PROCEDURE send_mail (p_sender IN VARCHAR2,
    p_recipient IN VARCHAR2,
    p_message IN VARCHAR2)
    as
    l_mailhost VARCHAR2(255) := 'yourdomain.com';
    l_mail_conn utl_smtp.connection;
    BEGIN
    l_mail_conn := utl_smtp.open_connection(l_mailhost, 25);
    utl_smtp.helo(l_mail_conn, l_mailhost);
    utl_smtp.mail(l_mail_conn, p_sender);
    utl_smtp.rcpt(l_mail_conn, p_recipient);
    utl_smtp.open_data(l_mail_conn );
    utl_smtp.write_data(l_mail_conn, p_message);
    utl_smtp.close_data(l_mail_conn );
    utl_smtp.quit(l_mail_conn);
    END;
    /

    e.g. exec send_mail ('me@here.com','you@there.com','Hello');

  3. #3
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    Many thanks andrew!!!

    I am now looking at doing HTML emails...hopefully it won't bee tooo hard!

Posting Permissions

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