6 Replies Latest reply on May 26, 2008 6:04 AM by Billy~Verreynne

    530 and 550 mail errors

    639708
      Hi,
      Is there any code to be added into my mail procedure that uses utl_smtp to prevent "530 5.7.0 Authentication required" and "550 relay access" errors. I can't send email from Oracle 10g.
      Any code for authenticattion?
      Thanks

      Message was edited by:
      veledrom
        • 1. Re: 530 and 550 mail errors
          damorgan
          What code? I don't see any code in what you posted? Do you?

          What mail server?

          10gR1 or 10gR2? Provide full version number please also.
          • 2. Re: 530 and 550 mail errors
            639708
            create or replace PROCEDURE MAIL_SP
            (name_in IN Varchar, surname_in IN Varchar, email_in IN Varchar)
            IS
            conn utl_smtp.connection;

            BEGIN

            conn := utl_smtp.open_connection ( 'mail.xxx.com', 25 ); -- SMTP database host and on port 25
            utl_smtp.helo( conn, 'mail.xxx.com' );
            utl_smtp.mail( conn, 'xxx@xxx.com' );
            utl_smtp.rcpt( conn, email_in );

            utl_smtp.data( conn,
            'From: Me' || utl_tcp.crlf ||
            'To: ' || email_in || utl_tcp.crlf ||
            'Subject: ' || 'Confirmation' ||
            utl_tcp.crlf || 'Dear'||' '||name_in||' '||surname_in||','
            ||chr(13)||chr(10)||chr(13)||chr(10)||'Welcome and thank you!'
            utl_smtp.quit(conn);

            END;

            Oracle Database 10g Release 10201_win32
            • 3. Re: 530 and 550 mail errors
              damorgan
              In 10.2 you should be using UTL_MAIL not the obsolete UTL_SMTP.

              You will find working demos of both in Morgan's Library at www.psoug.org.

              One warning ... you must have an internal email server and unchallenged access to use it. This can not be used with any email system that challenges for user-id and password either internal or external (for example gmail, yahoo, hotmail).
              • 4. Re: 530 and 550 mail errors
                639708
                Hi,

                I tried utl_mail and i still get exact errors that are;

                SMTP permanent error: 550 relay not permitted
                SMTP permanent error: 530 5.7.0 Authentication required

                Thanks

                Message was edited by:
                veledrom
                • 5. Re: 530 and 550 mail errors
                  damorgan
                  Here's what I wrote above:
                  "You must have an internal email server and unchallenged access to use it. This can not be used with any email system that challenges for user-id and password"

                  Here's your error message:
                  "530 5.7.0 Authentication required"

                  Nothing more need to said.

                  Which part of the advice I gave you didn't you understand?
                  • 6. Re: 530 and 550 mail errors
                    Billy~Verreynne
                    > I tried utl_mail and i still get exact errors that are;

                    Which are NOT Oracle errors at all - but errors returned by the SMTP server as it is not satisfied with your client requests to it. It cannot service these.

                    > SMTP permanent error: 550 relay not permitted

                    This means that (very correctly!) a server on domain B will not accept mail from a client on domain A that is to be send to a recipient on domain C. Domain B will not serve as a relay for domain A to get mail into domain C.

                    A standard anti-spam measure. One that if not implemented, will get the domain B SMTP server blacklisted on the Internet.

                    > SMTP permanent error: 530 5.7.0 Authentication required

                    Quite clearly the SMTP server expects your mail client (your PL/SQL code) to provide authentication details. Read [url http://www.faqs.org/rfcs/rfc2554.html]RFC 2554 - SMTP Service Extension for Authentication.

                    A pet beef of mine - how on earth can programmers expect to use an application protocol (like SMTP) when not even knowing the basics of the RFC that contains that protocol's specification?