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

Thread: utl_smtp - emailing outside my email domain?

  1. #1
    Join Date
    Jan 2003
    Posts
    35

    utl_smtp - emailing outside my email domain?

    Hi all,

    Database: 8.1.7.2
    OS: Solaris

    I've succesfully got my database to email me back when I send a test to it. When I email people within my domain at work it works fine but once I try to email outside our domain (trying to test with hotmail) I get some errors:-

    ERROR at line 1:
    ORA-20002: 554 Relay rejected for policy reasons.
    ORA-06512: at "SYS.UTL_SMTP", line 86
    ORA-06512: at "SYS.UTL_SMTP", line 223
    ORA-06512: at "CCTEST.SEND_MAIL", line 15
    ORA-06512: at line 1

    Has anyone had this before...? I'm using Lotus Notes..

    Below is the procedure I'm calling to email:-

    create or replace PROCEDURE send_mail (P_SENDER in varchar2,
    P_RECIPIENT in varchar2,
    P_SUBJECT in varchar2,
    P_MESSAGE in varchar2) is

    mailhost varchar2(30) := 'xxx.xxx.xx.xx';
    mail_conn utl_smtp.connection;
    crlf varchar2(2) := CHR(13)||CHR(10);
    mesg varchar2(4000);
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost,25);
    mesg := 'Date: '||to_char(sysdate,'dd Mon yy hh24:mi:ss' )||crlf||'FROM: '||P_SENDER||'>'||crlf||'Subject: '||P_SUBJECT||crlf||'To: '||P_RECIPIENT||crlf||''||crlf||P_MESSAGE;
    utl_smtp.helo(mail_conn,mailhost);
    utl_smtp.mail(mail_conn,P_SENDER);
    utl_smtp.rcpt(mail_conn,P_RECIPIENT);
    utl_smtp.data(mail_conn,mesg);
    utl_smtp.quit(mail_conn);
    END send_mail;
    /

    Thanks in advance

  2. #2
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    Hi,

    Outside relay i mean other than ur domain is not permitted in ur case.

    U better contact ur Email Admin. He will be able to sort it out.

    HTH

    Srini

  3. #3
    Join Date
    Jan 2003
    Posts
    35
    I've passed this to our email admin guys and they are scratching their heads... Can anyone please add to this....!

  4. #4
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    Hi,

    I m really surprised about this..

    This is generally the case, one is not allowed to relay to outside domain and the email admin should know how to enable that.

    Bcos even i had the same problem, when i did telnet using smtp port 25, and tried to send a mail it said relay outside ur domain is not permitted.

    Lets wait and see if someone posts about this.....or else let me know, i might try to find out...

    Srini

  5. #5
    Join Date
    Jan 2003
    Posts
    35
    Could this be a different prob or is it the same?

    Bcos even i had the same problem, when i did telnet using smtp port 25, and tried to send a mail it said relay outside ur domain is not permitted .
    My error is:-

    ORA-20002: 554 Relay rejected for policy reasons.

  6. #6
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    Hi,

    I think the solution for this might be

    adding the domain (www.hotmail.com or www.yahoo.com) to the
    DNS or relaying server.

    There r some domains only which have been given access to relay and as i understand hotmail.com is a domain to which u cant relay.

    It just needs to be added to the relaying list, i presume.

    Srini

  7. #7
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    The ball is definitely on lotus admins side.
    You can make a test case using telnet to port 25 to exclude oracle, so your lotus admins would not be bothered by it.
    They should enable smtp relaying for your ip address.
    Also, try some other external domains.
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

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