I get an SMTP Transient Error 501: attribute too long

I have an email programme built using PL/SQL. It fails when the email is over 6K bytes long. It fails when the line "utl_smtp.close_data(v_connection);" is executed.
The following message/s returned :- "SMTP Transient error: 501Attribute too long" I also receive the message "SMTP Transient error: 421 Service not available"
Both of these error messages report against a valid emal address and don't occur if the email message is below 5K.
The mail server will accept emails up to 10MB
From the point of construction:
1) I collect the necessary data
2) I build 'The Email' (this is a CLOB)
3) I connect to the SMTP servicer
4) Open the connection for data
5) Then in a loop, write the data
6) exit the loop when all data written
7) At the instruction "utl_smtp.close_data(v_connection);" the it all turns to tears. Giving me "SMTP Transient error: 501Attribute too long" and sometimes "SMTP Transient error: 421 Service not available"
The programme works fine on email being only a few Kb in size.
Can anybody suggest what the problem may be and /or a method of resolving it aside from spliting the email into smaller secting then sending each section.

Reposted under the correct forum: I can not resolve SMTP Transient error: 501Attribute too long
K.

Similar Messages

  • Send E-mail from Oracle (9.2.0.1) : SMTP transient error: 421 Service not a

    I have used Oracle 9i server (9.2.0.1 version) on Windows XP machine(with SP2).I want to send Email from PL/SQL procedure.
    My Question is what sort of configuration needed to perform this activity?
    I have installed IIS (Internet Information Service)
    in my machine, then configure my SMTP mail server
    with a valid email id and password given TCP port 465.
    Later I came to know that to send Email from PL/SQL I have to install Oracle JServer Code. Follow three steps. the steps are
    1. Execute the script as sys "$ORACLE_HOME\javavm\install\initjvm.sql"
    2. Execute the loadjava classfile as
    $ORACLE_HOME\plsql\jlib>loadjava -f -v -r -u sys/**** plsql.jar
    3. Execute the script as sys "$ORACLE_HOME\rdbms\admin\initplsj.sql"
    I sucessfully executed the first step, but for the second step iam not able to locate the plsql.jar file in the specified path.
    So Please tell me if there is any other method to perform this task
    My code is as follows.
    CREATE OR REPLACE PROCEDURE SEND_MAIL (
                                  msg_to varchar2,
                                  msg_subject varchar2,
                                  msg_text varchar2
                                  IS
                                  c utl_smtp.connection;
                                  rc integer;
                                  msg_from varchar2(50) := '[email protected]';
                                  mailhost VARCHAR2(30) := 'mail.google.com';
                             BEGIN
                                  c := utl_smtp.open_connection(mailhost, 465);
                                  utl_smtp.helo(c, mailhost);
                                  utl_smtp.mail(c, msg_from);
                                  utl_smtp.rcpt(c, msg_to);
                                  dbms_output.put_line(' Start Sending data');
                                  utl_smtp.data(c,'From: Oracle Database' || utl_tcp.crlf ||
                                  'To: ' || msg_to || utl_tcp.crlf ||
                                  'Subject: ' || msg_subject ||
                                  utl_tcp.crlf || msg_text);
                                  dbms_output.put_line(' Finish Sending data');
                                  utl_smtp.quit(c);
              EXCEPTION
                   WHEN UTL_SMTP.INVALID_OPERATION THEN
    dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
                   WHEN UTL_SMTP.TRANSIENT_ERROR THEN
    dbms_output.put_line(' Temporary e-mail issue - try again');
    WHEN UTL_SMTP.PERMANENT_ERROR THEN
    dbms_output.put_line(' Permanent Error Encountered.');
    END;
    Procedure Created.
    SQL> execute prc_send_mail('[email protected]','[email protected]','Good Morning.');
    BEGIN prc_send_mail('[email protected]','[email protected]','Good Morning.'); END;
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 17
    ORA-06512: at "SYS.UTL_SMTP", line 96
    ORA-06512: at "SYS.UTL_SMTP", line 374
    ORA-06512: at "SCOTT.PRC_SEND_MAIL", line 19
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at line 1.
    Please tell me how to solve this problem.
    Thank You.

    1) Why did you install an SMTP server locally and then tell your code to try to use the server mail.google.com?
    2) The error you're getting is from mail.google.com indicating that Google isn't running an open SMTP server there. I would be very surprised if Google were running a publicly available SMTP server anywhere since that would be an invitation for spammers.
    Justin

  • ORA-29279: SMTP permanent error: 501 5.5.2

    im getting the error
    ORA-29279: SMTP permanent error: 501 5.5.2 Syntax error in parameters scanning "FROM"
    kindly help . What is the problem exactly?

    I'm having this same issue now.
    This doesn't happen to my other databases on another server.
    Basically, I have a startup trigger that sends out mail, and I'm finding on database on a particular (new) server, UTL_SMTP is getting this error.
    Have you figured out your root cause?

  • ORA-29278: SMTP transient error: 421 Service not available

    Hi all,
    I'm using Oracle 10g working on Windows XP Home.
    I'm trying to send a basic mail from my stored procedure.
    When I tried to run the code, I get ORA-29278: SMTP transient error: 421 Service not available.
    Below is the code I'm trying.
    CREATE OR REPLACE PROCEDURE SEND_MAIL (
    msg_to varchar2,
    msg_subject varchar2,
    msg_text varchar2 )
    IS
    c utl_smtp.connection;
    rc integer;
    msg_from varchar2(50) := 'Oracle9.2';
    mailhost VARCHAR2(30) := '127.0.0.1'; -- local database host
    BEGIN
    c := utl_smtp.open_connection(mailhost, 25); -- SMTP on port 25
    dbms_output.put_line('ok');
    utl_smtp.helo(c, mailhost);
    utl_smtp.mail(c, msg_from);
    utl_smtp.rcpt(c, msg_to);
    utl_smtp.data(c,'From: Oracle Database' || utl_tcp.crlf ||
    'To: ' || msg_to || utl_tcp.crlf ||
    'Subject: ' || msg_subject ||
    utl_tcp.crlf || msg_text);
    utl_smtp.quit(c);
    EXCEPTION
    WHEN UTL_SMTP.INVALID_OPERATION THEN
    dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
    WHEN UTL_SMTP.TRANSIENT_ERROR THEN
    dbms_output.put_line(' Temporary e-mail issue - try again');
    dbms_output.put_line (sqlerrm);
    WHEN UTL_SMTP.PERMANENT_ERROR THEN
    dbms_output.put_line(' Permanent Error Encountered.');
    END;
    Below are the possibilites I tried..
    I tried to ping localhost.. This is the output I get
    C:\Documents and Settings\Me>ping localhost
    Pinging polasa [127.0.0.1] with 32 bytes of data:
    Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
    Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
    In one of the thread, a user suggested to do the following
    Go to Control Panel->Add or Remove Programs->Click on
    Add/Remove Wndows Components
    Check IIS check box.
    Select Internet Information Service (IIS) option and click on Details button
    Check whether SMTP Service is checked or not.
    If not selected then select SMTP check box.
    This process should be done on server.
    It will help out from ORA-29278: SMTP transient error: 421 Service not available
    problem.
    There is no IIS in my Windows Components..
    Any suggestions? Thanks in advance

    It sounds like you don't have an SMTP server running on your local machine.
    Even if you install IIS (or some other SMTP server), that is probably not enough to send email outside of your machine because your machine is unlikely to be trusted by the downstream mail servers. If you are running this in a company, you'll need to talk to your company's mail admin to determine where the corporate SMTP server is running. If you running this at home, you'll need to find out from your ISP what SMTP servers are available to you.
    Justin

  • ORA-12012: error on auto execute of job 754461 ORA-29279: SMTP permanent error: ORA-29279: SMTP permanent error: 501 Syntax error, parameters in command "RCPT TO:" unrecognized or missing ORA-06512: at "SYS.UTL_SMTP", line 20 ORA-06512: at "SYS.UTL_SMTP",

    Hi ,
    I am getting below error frequently in alert log of database.
    ORA-12012: error on auto execute of job 754461
    ORA-29279: SMTP permanent error: ORA-29279: SMTP permanent error: 501 Syntax error, parameters in command "RCPT TO:" unrecognized or missing
    ORA-06512: at "SYS.UTL_SMTP", line 20
    ORA-06512: at "SYS.UTL_SMTP", line 98
    ORA-06512: at "SYS.UTL_SMTP", line 240
    ORA-06512: at "APPS.EIS_UTIL_PKG", line 94
    ORA-06512: at "APPS.HKD_PO_ADDON_PKG", line 110
    ORA-06512: at line 1

    You have a job running in the database. Its job ID is 754461
    It looks as if that job runs APPS.HKD_PO_ADDON_PKG
    That job is attempting to send mail using UTL_SMTP and apparently passing some strange value to SMTP server for the RCPT TO: parameter.

  • UTL.MAIL error ORA-29279: SMTP permanent error: 501 Address Syntax Error in

    Hi,
    I am new to the forum so please excuse if I post incorrectly without conforming to the standards.
    We need to send mails using the UTL.MAIL package and have installed them on the database.
    Whenever I am trying to send an email I am getting the following error:
    ERROR at line 1:
    ORA-29279: SMTP permanent error: 501 Address Syntax Error in
    [email protected]
    ORA-06512: at "SYS.UTL_MAIL", line 654
    ORA-06512: at "SYS.UTL_MAIL", line 671
    ORA-06512: at line 2
    The test code which I am running is as follows:
    BEGIN
    UTL_MAIL.send(sender => 'test <[email protected]>',
    recipients => '[email protected]',
    subject => 'UTL_MAIL test subject',
    message => 'UTL_MAIL test body');
    END;
    I have tried different combinations:
    BEGIN
    UTL_MAIL.send(sender => 'test "<[email protected]>"',
    recipients => '[email protected]',
    subject => 'UTL_MAIL test subject',
    message => 'UTL_MAIL test body');
    END;
    even tried
    BEGIN
    UTL_MAIL.send(sender => '[email protected]',
    recipients => '[email protected]',
    subject => 'UTL_MAIL test subject',
    message => 'UTL_MAIL test body');
    END;
    Everytime I am getting the same error.
    This seems to be working with an exchange mail server but never on the SMTP server.
    In the SMTP server logs the sender address is not having the angular brackets <> unlike the other mails which are being sent over.
    It seems that the SMTP server is pretty strict and the SMTP admin will not change any settings on the server.
    The oracle version is as follows
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    Could you please help me out with a solution.
    Some how the angular brackets are geting stripped off (which UTL MAIL package generally does), Is there any way in which I can include the angular brackets.
    Edited by: 984757 on 29-Jan-2013 02:56
    Edited by: 984757 on 29-Jan-2013 02:57

    I dislike UTL_MAIL - clunky and poor abstraction interface, and not well written.
    Had a look at the code. It does this:
    WHILE (ALL_RCPTS IS NOT NULL) LOOP
          UTL_SMTP.RCPT(MAIL_CONN,'&lt;' || GET_ADDRESS(ALL_RCPTS) || '&gt;');
    END LOOP;The GET_ADDRESS() function process the ALL_RCPTS parameter, returns the 1st address from it, and updates the (in/out) parameter with the remaining string.
    SQL> var address varchar2(200);
    SQL> exec :address := '<[email protected]>,[email protected]';
    PL/SQL procedure successfully completed.
    SQL> exec dbms_output.put_line( 'get_address='||UTL_MAIL.GET_ADDRESS(:address)||' address='||:address );
    get_address=[email protected] address=[email protected]
    PL/SQL procedure successfully completed.
    SQL> exec dbms_output.put_line( 'get_address='||UTL_MAIL.GET_ADDRESS(:address)||' address='||:address );
    get_address=[email protected] address=
    PL/SQL procedure successfully completed.
    SQL> The address is explicitly surrounded by brackets as per the RFC. So that is what your SMTP server should see.
    If not - perhaps then our UTL_MAIL versions do not match. Cannot recall from what version I pulled and unwrapped the UTL_MAIL package code I have.
    Personally though, I've ceased using UTL_MAIL a while back. It lacks in may respects. I have written my own mail package that supports multiple attachment, complex Mime formatting, attachments of 20+ MB in size, and so on - running on the UTL_SMTP interface (that provides the transport layer for sending mail). And for issues like you are facing, I suggest considering using UTL_SMTP directly.
    Edited by: Billy Verreynne on Jan 29, 2013 12:52 PM
    (Updated the code with HTML entity names to get the code snippet to render correctly)

  • ORA-29278: SMTP transient error - Need Help

    I am getting below error from my code block though i am not calling UTL_SMTP package.
    It is confusing to me and I am not getting how to debug this.
    Please help me.
    My Orable DB Version - Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    Error Message
    ERROR: -29278 ORA-29278: SMTP transient error: 421 Service not
    available
    ORA-06512: at "SYS.UTL_SMTP", line 20
    ORA-06512: at "SYS.UTL_SMTP",
    line 96
    ORA-06512: at "SYS.UTL_SMTP", line 138
    ORA-06512: at "W_ADM_DW.DW
    PL/SQL procedure successfully completed.
    {code}
    *Pseudo-code  of my code block*
    {code}
    VARIABLE Ret number
    set serveroutput on size 20000
    show serveroutput
    DECLARE
    --Local variable declaration
    BEGIN
         select count(*)
         into v_count
         from <Table_Name>
         where   <Column_Name>=<YYYYMM>;
         if v_count > 0 then
            SELECT PARTITION_NAME
            INTO v_partition_name
            FROM ALL_TAB_PARTITIONS
            WHERE TABLE_NAME='<Table_Name>'
            AND INSTR(PARTITION_NAME,<YYYYMM>,1,1)<>0;
             v_sql := utl_particion.truncate_partition('&3','<Table_Name>', v_partition_name);
                if v_sql!=0 then
                     raise_application_error(-20088,'Error in Truncate partition');
                    :Ret := 2;
                end if;
            commit;
         end if;
          v_sql:='alter session enable resumable timeout 72000 name ''<Table_Name>''';
          execute immediate v_sql;
          v_sql := '       INSERT /*+ APPEND*/ INTO '<Table_Name>'';
          v_sql := v_sql || ' (  <column_name1>, ';
          v_sql := v_sql || '    <column_name2>, ';
          v_sql := v_sql || '    <column_name3>, ';
          v_sql := v_sql || '    <column_name4>, ';           
          v_sql := v_sql || ' ) ';
          v_sql := v_sql || ' SELECT /*+ PARALLEL(<Source_Table_Name>,6)*/';
          v_sql := v_sql || '        <column_name1>, ';
          v_sql := v_sql || '        <column_name2>, ';
          v_sql := v_sql || '        <column_name3>, ';
          v_sql := v_sql || '        <column_name4>, ';         
          v_sql := v_sql || '     FROM <Source_Table_Name> WHERE <column_name> BETWEEN ' || v_frm_date || ' AND ' || v_to_date;
          execute immediate v_sql;
             v_total:=SQL%ROWCOUNT;          
          commit;
    EXCEPTION
        WHEN OTHERS THEN
          ROLLBACK;
          dbms_output.put_line ('ERROR: '|| SQLCODE || ' ' || substr(SQLERRM,1,200));
           :Ret := 2;
    END;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for identifying utl_particionpackage. I tried to check the code of this package, but it has wrapped, so i cannot see the code.
    But one thing i have observed - If utl_particion.truncate_partition internally calling UTL_SMTP package and I am getting error from this package then this will catch by below code -
             v_sql := utl_particion.truncate_partition('&3','<Table_Name>', v_partition_name);
                if v_sql!=0 then
                     raise_application_error(-20088,'Error in Truncate partition');
                    :Ret := 2;
                end if;and after that it will catch by user define error exception block (This i did not mention in my earlier post)
        WHEN excepcion_ctrl THEN
            dbms_output.put_line (WRN: '|| substr(SQLERRM,4,200));
            :Ret:=0;But it has catch by when others exception -
    I think inside utl_particion.truncate_partition procedure has proper exception handling. So when some error will occur it will return '0'. If there is no proper exception handling then we can assume the error will propagate to When Others Exception block.
    Please tell me my understanding is correct or not.

  • SMTP transient error

    Sometimes I get the following error message.
    ORA-29278
    which means
    (SMTP transient error: string
    Cause: An SMTP transient error occurred.
    Action: Correct the error and retry the SMTP operation.)
    My problem is this does not happen all the time. If the form works and then i get this message how can i track it down. I think someone here is doing something with the smtp. How do i know that smtp is working right now.

    thanks for pointing out that documentation issue, i'll log it in a bit. we now call those internal preferences "engine settings". you can get to that section of the admin screens by clicking the first link available in the htmldb_admin interface called "Manage Engine Settings". make sure you do set your SMTP_HOST_ADDRESS and SMTP_HOST_PORT preferences from there before you do this mail stuff. once that's set, you can push you queue with a command like...
    wwv_flow_mail.push_queue(
    wwv_flow_platform.get_preference('SMTP_HOST_ADDRESS'),
    wwv_flow_platform.get_preference('SMTP_HOST_PORT'));
    ...but you'll find your FLOWS_ user already has that db job scheduled by default. about your smtp error, i'd confirm that it's not a db issue first by trying to send mail from the operating system level. if you can send mail from there (w/o using the db and not from within html db), do let us know. the url in your error message, http://pobox.com/~djb/docs/smtplf.html, seems to suggest that the problem has to do with your SMTP server, so eliminating the other variables (like the db and html db) would be a good start.
    regards,
    raj

  • How can I solve ORA-29278: SMTP transient error: 421 Service not available

    Hi
    I have two different Solaris Server (Server1 & server2).
    In both the server SMTP server is configured.
    In these two solaris server (Server1 & server2) we have installed Oracle 9i
    I am using client machine to execute the following procedure.
    When I connect to server1 (using SQL plus) and execute the following procedure, it works fine, and able to send emails properly.
    But when I connect to server2 (using SQL plus) and execute the following procedure, I get the follwoing error.
    Could you please help me to resolve this?
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    SQL> set define off
    SQL> set serveroutput on size 1000000
    SQL> BEGIN
    2 mail_files( 'localhost',
    3 'Frm',
    4 '[email protected]',
    5 'From production',
    6 'Test message from production',
    7 9999999999,
    8 NULL,
    9 NULL,
    10 NULL,
    11 0 );
    12 END;
    13 /
    BEGIN
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 17
    ORA-06512: at "SYS.UTL_SMTP", line 96
    ORA-06512: at "SYS.UTL_SMTP", line 327
    ORA-06512: at "PROD_L.MAIL_FILES", line 238
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at line 2
    SQL>

    Hi
    I have two different Solaris Server (Server1 & server2).
    In both the server SMTP server is configured.
    In these two solaris server (Server1 & server2) we have installed Oracle 9i
    I am using client machine to execute the following procedure.
    When I connect to server1 (using SQL plus) and execute the following procedure, it works fine, and able to send emails properly.
    But when I connect to server2 (using SQL plus) and execute the following procedure, I get the follwoing error.
    Could you please help me to resolve this?
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    SQL> set define off
    SQL> set serveroutput on size 1000000
    SQL> BEGIN
    2 mail_files( 'localhost',
    3 'Frm',
    4 '[email protected]',
    5 'From production',
    6 'Test message from production',
    7 9999999999,
    8 NULL,
    9 NULL,
    10 NULL,
    11 0 );
    12 END;
    13 /
    BEGIN
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 17
    ORA-06512: at "SYS.UTL_SMTP", line 96
    ORA-06512: at "SYS.UTL_SMTP", line 327
    ORA-06512: at "PROD_L.MAIL_FILES", line 238
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at line 2
    SQL>

  • UTL_SMTP with Sendmail: Solution for ORA-29278: SMTP transient error

    For those of you migrating from Windows or other platforms to Linux (Redhat Enterprise AS 3.0, in my case) and have email routines using UTL_SMTP, I have a hard-earned hint for you. If your email routines are not working when you try to use the local smtp service (sendmail) try the following at the SQL prompt.
    set serverout on
    declare
    c utl_smtp.connection;
    r utl_smtp.reply;
    begin
    c := utl_smtp.open_connection('local.email.server', 25);
    utl_smtp.helo(c,'local.email.server');
    end;
    If you get ORA-29278: SMTP transient error: 421 Service not available, try the following instead:
    set serverout on
    declare
    c utl_smtp.connection;
    r utl_smtp.reply;
    begin
    c := utl_smtp.open_connection('127.0.0.1', 25);
    utl_smtp.helo(c,'127.0.0.1');
    end;
    And you should get success. So you should specify the internal loopback IP address for the email hostname in the open_connection function. It will not work with anything else (servername, localhost, NIC IP).
    The reason for this is that there is a setting in the sendmail config file (/etc/mail/sendmail.mc) that causes sendmail to only listen on 127.0.0.1. As long as you aren't using sendmail as a relay, this isn't a problem.
    Just specify 127.0.0.1 for the email hostname in the open_connection function.
    Hope this helps someone.
    Trenton

    Hi;
    What is DB version?
    Please see:
    From Master Note For PL/SQL UTL_SMTP and UTL_MAIL Packages [ID 1137673.1] check Note 604763.1 "ORA-29278: SMTP transient error: 421 Service not available" When Using UTL_SMTP to Send Email.
    Regard
    Helios

  • ORA-29278: SMTP transient error:421 Service not available on oracle 10g

    HIi,
    I am trying to send e-mails by using PL/Sql procedure . I am using UTL_MAIL/UTL_SMTP on oracle 10g R1 database.
    There is no problem in creating procedure,but when i am doing execution i am getting the mention error.
    I am trying to send mail with attachment as excel file.
    ORA-20001: The following error has occured: ORA-29278: SMTP transient error:
    421 Service not available
    ORA-06512: at "SCOTT.MAIL_ATT_RAW", line 64
    ORA-06512: at line 1
    -----my procedure code------
    CREATE OR REPLACE PROCEDURE mail_att_raw(filename varchar2) AS
    fil BFILE;
    file_len PLS_INTEGER;
    MAX_LINE_WIDTH PLS_INTEGER := 54;
    buf RAW(2100);
    amt BINARY_INTEGER := 2000;
    pos PLS_INTEGER := 1; /* pointer for each piece */
    filepos PLS_INTEGER := 1; /* pointer for the file */
    filenm VARCHAR2(50) := filename; /* binary file attachment */
    data RAW(2100);
    chunks PLS_INTEGER;
    len PLS_INTEGER;
    modulo PLS_INTEGER;
    pieces PLS_INTEGER;
    err_num NUMBER;
    err_msg VARCHAR2(100);
    resultraw RAW(32000);
    BEGIN
    /* Assign the file a handle */
    fil := BFILENAME('BFILE_DIR', filenm);
    /* Get the length of the file in bytes */
    file_len := dbms_lob.getlength(fil);
    /* Get the remainer when we divide by amt */
    modulo := mod(file_len, amt);
    /* How many pieces? */
    pieces := trunc(file_len / amt);if (modulo <> 0) then
    pieces := pieces + 1;end if;/* Open the file */
    dbms_lob.fileopen(fil, dbms_lob.file_readonly);/* Read the first amt into the buffer */
    dbms_lob.read(fil, amt, filepos, buf);/* For each piece of the file . . . */
    FOR i IN 1..pieces LOOP/* Position file pointer for next read */
    filepos := i * amt + 1;/* Calculate remaining file length */
    file_len := file_len - amt;/* Stick the buffer contents into data */
    data := utl_raw.concat(data, buf);/* Calculate the number of chunks in this piece */
    chunks := trunc(utl_raw.length(data) / MAX_LINE_WIDTH);/* Don't want too many chunks */
    IF (i <> pieces) THEN
    chunks := chunks - 1;
    END IF;/* For each chunk in this piece . . . */
    FOR j IN 0..chunks LOOP/* Position ourselves in this piece */
    pos := j * MAX_LINE_WIDTH + 1;/* Is this the last chunk in this piece? */
    IF (j <> chunks) THEN len := MAX_LINE_WIDTH;
    ELSE
    len := utl_raw.length(data) - pos + 1;
    IF (len > MAX_LINE_width) THEN
    len := MAX_LINE_WIDTH;
    END IF;
    END IF;/* If we got something, let's write it */
    IF (len > 0 ) THEN
    resultraw := resultraw || utl_raw.substr(data, pos, len);
    END IF;
    END LOOP;/* Point at the rest of the data buffer */
    IF (pos + len <= utl_raw.length(data)) THEN
    data := utl_raw.substr(data, pos + len);
    ELSE
    data := NULL;
    END IF;/* We're running out of file, only get the rest of it */
    if (file_len < amt and file_len > 0) then
    amt := file_len;
    end if;/* Read the next amount into the buffer */dbms_lob.read(fil, amt, filepos, buf);
    END LOOP;/* Don't forget to close the file */
    dbms_lob.fileclose(fil);
    SYS.UTL_MAIL.SEND_ATTACH_RAW(sender => '[email protected]', recipients => '[email protected]',subject => 'Testmail', message => 'Hallo', attachment => resultraw, att_filename => filename);
    EXCEPTION
    WHEN OTHERS THEN--dbms_output.put_line('Fehler');
    raise_application_error(-20001,'The following error has occured: ' || sqlerrm);
    END;
    Please suggest me what settings i need to change. This same procedure is running on another maching,but not on my machine.
    If somebody is having any other simple procedure ,please help me.
    My SMTP port -25
    Thanks in advance.

    Hi Justin,
    Please get the answers of your queries
    The error you're getting is coming from the SMTP server you are trying to connect to.
    - What SMTP server is your database configured to use?
    Reply - I am using IIS(5.0)
    - What SMTP server is the database where this code is working configured to use?
    Reply - Same IIS. Database is installed locally on my machine only. I am trying to send mail locally to me only,Not to the outside person.
    - Has the SMTP server been configured to allow connections from both machines?
    Reply - Yes
    One more query, do we really require to set the SMTP_OUT_SERVER parameter for SCOPE=BOTH
    ALTER SYSTEM SET smtp_out_server = '172.16.1.10' SCOPE=BOTH
    I am not able to set like this for BOTH,only for SPFILE i can set ?.
    My SMTP Server IP=172.16.1.10
    PORT- 25
    Thanks
    Manoj

  • SMTP permanent error: 501 5.1.7 Invalid address

    hi,
    I am getting follwoing error where executing procedure. i am able to send from that server
    ERROR at line 1:
    ORA-29279: SMTP permanent error: 501 5.1.7 Invalid address
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 99
    ORA-06512: at "SYS.UTL_SMTP", line 222
    Thanks,

    Seems the issue is with the email address which you are referring to in your execution or else please check whether the smtp server is configured properly.

  • Bug? htmldb_util.reset_pw gives ORA-29278: SMTP transient error 451

    After changing mailprovider we had some troubles mailing from the database.
    After mailing to his SMTP-server we got the error message:
    ORA-29278: SMTP transient error: 451
    We were able to correct our custom code by replacing all the end-of-line LF with calls to
    UTL_TCP.CRLF.
    However, our Apex-application is still broken. By calling HTMLDB_UTIL.RESET_PW
    the system should mail the new pwd to our user.
    Should
    But it doesn't
    In the Mail Log/queue we again get the ORA-29278,
    so my deduction is that in the message that RESET_PW assembles a single LF is
    used and not the CRLF.
    Question: is there a way to overcome this bug?
    BTW, the SMTP-server is present. Writing a HTMLDB_MAIL.SEND by hand gives no trouble at all.

    CRLF characters are required to separate each SMTP command, per RFC 821 (http://www.ietf.org/rfc/rfc0821.txt), and that is what the APEX_MAIL package does.
    But the portion that "you are afraid of" which contains CHR(10) is the message[b] body of the reset password functionality of APEX - there can be any combination of characters in there. It is not a requirement that the body of the message uses CRLF for line endings. So, unfortunately, I don't think the deduction applies here.
    Let's start with some basic things. If you change the "SMTP Host Address" in the internal Administration Services of APEX to a known good SMTP host, does the problem go away?
    451 means "Requested action aborted: error in processing". That could be anything. It could even be an issue with your provider, your connection to the provider, etc. Does your provider have a log of the incoming "conversation" and a log of the abort? That may be helpful.
    Joel
    P.S. By the way, which version of Application Express/HTML DB are you using?

  • Mail Error: ORA-29278: SMTP transient error: 421 Service not available

    I write process to send mail, it is running ok, but I have error ORA-29278: SMTP transient error: 421 Service not available.
    SMTP Host Address : localhost
    SMTP Host Port : 25
    When I connect to database as SYS and run : exec apex_mail.push_queue result is :
    Pushing email: 1225814842675154
    Pushed email: 1225814842675154
    PL/SQL procedure successfully completed.
    Please explain me what is happened!

    Hi;
    What is DB version?
    Please see:
    From Master Note For PL/SQL UTL_SMTP and UTL_MAIL Packages [ID 1137673.1] check Note 604763.1 "ORA-29278: SMTP transient error: 421 Service not available" When Using UTL_SMTP to Send Email.
    Regard
    Helios

  • Unable to send Email: ORA-29279: SMTP permanent error: 501 Syntax error in

    We have a procedure use utl_smtp in 10g (10.0.4). we got this msg (Unable to send Email: ORA-29279: SMTP permanent error: 501 Syntax error in arguments) when send e-mail to another mail box (internal),
    but we use the same procedure running in 10g(10.03) it works perfectly. Is Oracle 10g(10.0.4 vs. 10.0.3) causing this issue ? Can someone shed some lights on my head ? Thx.

    We found what is wrong about this.
    The problem is in CC we had a e-mail address has one space like this test [email protected] so UTL_smtp doesn't like this kind format then we recreated a new e-mail address without space and it works fine.

Maybe you are looking for

  • How can you search for outlook email folders quickly?

    I am connected to my work outlook email system and within outlook I have circa 500+ folders. From the iPhone you can see all the folders in the email account but the list is (a). expanded {which makes the list huge} and (b). there appears to be no fa

  • Please help me install 10.5.2!

    I tried installing the update on my macbook it went about a quarter through the installation then stoped and stayed at the same point for over 2:30 hours so I restarted it and tried again it wont install, so I downloaded the combo update from Apple w

  • Anyone have experience using ALE message FIDCC2 in a high volume scenario?

    Hi, We are evaluating the use of message type FIDCC2 to send complete FI documents from one SAP system (logisitics) to another SAP system (finance).  I'm particularly interested in throughput performance, as this will be a high volume scenario (300K+

  • How to get BI role in portal 2004s

    is there any delevered roles of BI/IP in portal 2004s ? do we have to download Business Package from SAP site to get more roles as we do not see any delivered roles for BI and IP in user admin of portal

  • URL and taskflow

    Hi, Per Shay's demo, created a bounded task flow to execute a jspx page from an http URL with parameters. Have the task flow like this ExecuteWithParams ----> mypage.jspx Works fine. There is a inline popup in the jspx page. When one of the button is