DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: MAIL SENDING FROM ORACLE--hELP REQUIRED

  1. #1
    Join Date
    Apr 2003
    Posts
    353

    MAIL SENDING FROM ORACLE--hELP REQUIRED

    pLEASE ADVICE ON THE BELOW MAIL FROM MY FRIEND..
    THANKS VERY MUCH


    Hi ,

    Please go thro' this procedure in oracle pl/sql.This below procedure is not working. When i compile it , it is not giving any error. It is compiled successfully. But if i execute this procedure , it is hanging. Here database server and mail server are in different system. Please tell me what the problem is and how to proceed. 145.145.50.1 is our mail server ip address.
    Expecting ur reply,

    CREATE OR REPLACE PROCEDURE SP_SEND_MAIL (SENDER IN VARCHAR,RECEIPIENT IN VARCHAR,
    MESSAGE IN VARCHAR)
    IS
    MAILHOST VARCHAR(30):='145.145.50.1';
    MAIL_CON UTL_SMTP.CONNECTION;
    BEGIN
    MAIL_CON:=UTL_SMTP.OPEN_CONNECTION(MAILHOST, 80);
    UTL_SMTP.HELO(MAIL_CON, MAILHOST);
    UTL_SMTP.MAIL(MAIL_CON, SENDER);
    UTL_SMTP.RCPT(MAIL_CON, RECEIPIENT);
    UTL_SMTP.DATA(MAIL_CON, MESSAGE);
    UTL_SMTP.CLOSE_DATA(MAIL_CON);
    UTL_SMTP.QUIT(MAIL_CON);
    END;

  2. #2
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    use functions instead of procedures and get yourself some feedback as
    Code:
    declare
    res utl_file.reply;
    ...
    begin
      ...
      res:=utl_smtp.helo(mail_con, mailhost);
      dbms_output.put_line(res);
      ...
    end;
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

  3. #3
    Join Date
    Jul 2003
    Posts
    59
    I'm not sure if this will fix it, but you do not need the close_data() call when you use the data() function.

  4. #4
    Join Date
    Feb 2003
    Location
    INDIA
    Posts
    96
    please check with your MAIL administrator and confirm the port # which is coded as 80 in following statement. If it is different please change.

    MAIL_CON:=UTL_SMTP.OPEN_CONNECTION(MAILHOST, 80);

    Cheers
    Dilip Patel
    OCP 8i

    Catch me online at Yahoo: ddpatel256

Posting Permissions

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


Click Here to Expand Forum to Full Width