10G UTL_MAIL Message

Hi,
1. Is it possible to return the result from a select into an email message using UTL_MAIL ?
2. Where can I find some 10G UTL_MAIL code examples ?
Thank you.

Hi,
1. Is it possible to return the result from a select into an email message using UTL_MAIL ?
2. Where can I find some 10G UTL_MAIL code examples ?
Thank you.

Similar Messages

  • 10G UTL_MAIL.SEND and message bigger than a LONG variable ?

    Hi,
    Is it possible to send out a message containing more that 32767 characters (LONG) using 10G UTL_MAIL.SEND. I have to send a big HTML report (inline).
    Thank's

    Hi
    its true we cannot use UTL_MAIL package for sending mails with Attachments as it can be used only for attachments of size less than 32KB. For higher sizes i referred Metalink an found the below info regarding UTL_SMTP.
    This is the doc Id
    Doc ID:      Note:357385.1
    Doc ID:      Note:414062.1
    Doc ID:      Note:334734.1
    Doc ID:      Note:302943.1
    Hope this docs helps u in your findings.
    however, i have dropped my plans to send mail with attachments as mailbox has size limits and my files can be very big. SO, i would instead store the file in to a customr notified location and send him a mail about the presence of the file. I know this is not the right approach but i cudnt find a better approach than this. If any one can fin a better solution plz post it here.
    Regards
    Vibhuti

  • AWM 10g - error message

    I am having fun getting started with AWM.
    I cannot login into an oracle 10g database with AWM 10g. I get this error message:
    java.sql.SQLException: t2cCreateState
    at oracle.olap.awm.connection.ConnectionManager.connect(ConnectionManager.java:116)
    at oracle.olap.awm.connection.ConnectionDialogActionThread.doAction(ConnectionDialogActionThread.java:73)
    at oracle.olap.awm.ui.dialog.ThreadedDialogActionThread.run(ThreadedDialogActionThread.java:49)
    What does this mean?
    Thanks,
    Frank.

    What are you writing in connection information? Try using full details like hostname:port:sid and then try.
    Also ensure that the correct ORACLE_HOME is set in the PATH variable.
    Thanks
    Brijesh

  • 10G UTL_MAIL question

    I've followed this:
    http://www.oracle-base.com/articles/10g/PlsqlEnhancements10g.php#UTL_MAIL
    Question is:
    Is it possible that I can use 'to_recipient_variable' instead of hard coded values ([email protected], [email protected], etc.) in Recipient because I want to use this feature in my search form that I've created using 10G-forms builder.
    fyi:
    I've 'email_field' in the 10G DB which I will search through 10G-based form and after getting the result I want to send emails to everybody who got the hit.
    Thanks.
    Gaurav

    This is a database question better suited for the database forum. But having said that...
    You can create a stored prcedure in the database, and pass the values to it that you want the procedure to use. You don't need to hardcode the values.

  • Reg.SMTP Error while using UTL_MAIL in Oracle 10g

    Hi,
    I am getting the following SMTP error while trying to use the UTL.MAIL package of Oracle 10g. The query is as follows.
    begin
    utl_mail.send(
    sender => 'NAVEEN',
    recipients => '[email protected]',
    subject => 'Testing utl_mail',
    message => 'The receipt of this email means'|| ' that UTL_MAIL works'
    end;
    UTL_MAIL package is installesd and the port 25 is configured and firewall is changed.
    The same block was working fine before 5 days and now is giving the error as
    ORA-29279: SMTP permanent error: 501 badly formatted MAIL FROM user - no "<"
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 99
    ORA-06512: at "SYS.UTL_SMTP", line 222
    ORA-06512: at "SYS.UTL_MAIL", line 407
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    Could you please help me out how to proceed???
    Regards,
    Naveen Kumar.

    Can you back that statement about an Oracle UTL_SMTP bug up with an actual bug number??
    From what you have posted, this is not a bug!! but expected and documented (RFC'ed) SMTP server behaviour.
    My proof:
    /home/billy> telnet mail 25
    Trying 165.143.128.26...
    Connected to mail
    Escape character is '^]'.
    220 CNTRRA20-GTW01 [CNTRRA20-GTW01] Thu, 06 Mar 2008 14:26:26 +0200
    HELO 10.251.93.58
    250 CNTRRA20-GTW01 Hello [10.251.93.58]
    MAIL FROM: naveen <[email protected]>
    501 naveen <[email protected]> : illegal character(s) in domain string
    MAIL FROM: NAVEEN
    501 NAVEEN : domain string is NULL.
    quit
    221 CNTRRA20-GTW01 closing connection. Goodbye!
    Connection closed by foreign host.
    /home/billy>
    As you can clearly see, the SMTP server expects a DOMAIN name as part of the MAIL FROM address. It also does not accept the alternative format suggested.
    Yes, not all SMTP servers are equal and some support additional formatting.
    But to imply that because the SMTP server does not accept your address formatted as string NAVEEN, it is a UTL_SMTP problem, sounds like a smelly one to me.

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • ORA-29279: SMTP permanent error: To Send Mail from Oracle 10g (10.2.0.1)

    I have installed Oracle 10g (10.2.0.1) on Windows XP (SP2) machine at my home PC.There is a broadband connection on my home PC.I have installed UTL_MAIL package and then set SMTP_OUT_PARAMETER by the following SQL Statement.
    My machine IP address is 192.168.0.3
    SQl> alter system set smtp_out_server = 'smtp.bsnl.in:25' scope = 25;
    Then we run the following script.
    BEGIN
    UTL_MAIL.SEND(
    SENDER => '[email protected]',
    RECIPIENTS => '[email protected]',
    SUBJECT => 'Testing UTL_MAIL',
    MESSAGE => 'The receipt of this email means'||
    'that it works for UTL_MAIL'
    END;
    Then following error message comes.
    BEGIN
    ERROR at line 1:
    ORA-29279: SMTP permanent error: 553 Authentication is required to send mail as
    <[email protected]>
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 99
    ORA-06512: at "SYS.UTL_SMTP", line 222
    ORA-06512: at "SYS.UTL_MAIL", line 407
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    Can anybody suggest the solution of the above problem.

    Hi,
    is your smtp server configured to use anonymous connection?
    Attackwave
    Reply Code       Description
    211      System status, or system help reply
    214      Help message [Information on how to use the receiver or the meaning of a particular non-standard command; this reply is useful only to the human user]
    220      <domain> Service ready
    221      <domain> Service closing transmission channel
    250      Requested mail action okay, completed
    251      User not local; will forward to <forward-path>
    252      OK, pending messages for node <node> started. Cannot VRFY user (for example, info is not local), but will take message for this user and attempt delivery.
    253      OK, <messages> pending messages for node <node> started
    354      Start mail input; end with <CRLF>.<CRLF>
    355      Octet-offset is the transaction offset
    421      <domain> Service not available, closing transmission channel (This may be a reply to any command if the service knows it must shut down.)
    450      Requested mail action not taken: mailbox unavailable [for example, mailbox busy]
    451      Requested action terminated: local error in processing
    452      Requested action not taken: insufficient system storage
    453      You have no mail.
    454      TLS not available due to temporary reason. Encryption required for requested authentication mechanism.
    458      Unable to queue messages for node <node>
    459      Node <node> not allowed: reason
    500      Syntax error, command unrecognized (This may include errors such as command line too long.)
    501      Syntax error in parameters or arguments
    502      Command not implemented
    503      Bad sequence of commands
    504      Command parameter not implemented
    521      <Machine> does not accept mail.
    530      Must issue a STARTTLS command first. Encryption required for requested authentication.
    534      Authentication mechanism is too weak.
    538      Encryption required for requested authentication mechanism.
    550      Requested action not taken: mailbox unavailable [for , mailbox not found, no access]
    551      User not local; please try <forward-path>
    552      Requested mail action terminated: exceeded storage allocation
    *553      Requested action not taken: mailbox name not allowed [for example, mailbox syntax incorrect]*
    554      Transaction failed

  • Utl_mail problem

    Hi I am using 10g forms .
    I have installed
    @c:\DevSuiteHome_1\rdbms\admin\utlmail.sql
    @c:\DevSuiteHome_1\rdbms\admin\prvtmail.plb
    with no errors.
    then
    ALTER SYSTEM SET smtp_out_server = xyz/abd/mnc.com'SCOPE=SPFILE;
    xyz/abd/mnc = my email id. i am using lotus notes as default company email service.
    O nthe form i have created a button with code
    declare
    begin
    utl_mail.send(
    sender => 'my email.com',
    recipients => 'something.com',
    subject => 'Testing utl_mail',
    message => 'The receipt of this email means FOR UTL_MAIL ');
    END;
    WHEN I CLICK THE BUTTON NOTHING HAPPENS !
    what am i missing here ??
    plz help i am stuck at this for lonnnng time now .
    cheers

    SECOND try .
    i created a procedure ::::
    PROCEDURE send_email IS
    BEGIN
    UTL_MAIL.SEND(sender => '[email protected]',
    recipients => '[email protected]',
    cc => '[email protected]',
    bcc => '[email protected]',
    subject => 'Testmail',
    message => 'Hallo');
    end;
    and on the bbutton a put SEND_EMAIL;
    STILL NO GOOD.
    i dont even get any errors , simply nothing happens when i click !

  • TABLE_FROM_BLOCK is not working in forms 10g ??????

    Hi all,
    How to use TABLE_FROM_BLOCK in forms 10g. its working in forms 6i .
    the same form is not working in 10g . i got this error.
    frm-40933 Cannot populate table because datatype is incorrect.
    pls help me
    Regards
    Gopinath M

    According to Metalink's Developer 2.1 Release Notes (Doc ID #90090.1), section 4.2.1, "TABLE_FROM_BLOCK Built-In":
    DO NOT use the TABLE_FROM_BLOCK built-in described in the
    documentation. It is reserved for internal use only. No support
    for this built-in will be provided under any circumstances.
    If you used this built-in, you will need to recode your from(s) for 10g.
    Message was edited by:
    Mark Roberts

  • F7 & F8 key is not working in forms 10g

    Dear all,
    I am working with oracle application version 10.1.2.3.0, installed on windows server 2003 and database 10gR2 on windows server 2008. When i open any form and tries F8 / F7 to executed & enter
    query, its not working. But its owrking with with F11 and shitp + F11. I want to use F7 & F8 for enter/execute the query. I have same another same environment with same configuration, there F7
    & F8 is working fine. To enable these keys i rename fmrpcweb.res to fmrweb.res. But guide me with your sincere suggessions & experience.
    Regards,
    Ahmed.

    According to Metalink's Developer 2.1 Release Notes (Doc ID #90090.1), section 4.2.1, "TABLE_FROM_BLOCK Built-In":
    DO NOT use the TABLE_FROM_BLOCK built-in described in the
    documentation. It is reserved for internal use only. No support
    for this built-in will be provided under any circumstances.
    If you used this built-in, you will need to recode your from(s) for 10g.
    Message was edited by:
    Mark Roberts

  • 10g Refresh Snapshot log question

    Hi,
    I need to run complete refresh on a materialized view log.
    BEGIN
    DBMS_SNAPSHOT.REFRESH(
    LIST => 'XYZ_DETAIL'
    ,METHOD => 'C'
    ,PUSH_DEFERRED_RPC => TRUE
    ,REFRESH_AFTER_ERRORS => FALSE
    ,PURGE_OPTION => 1
    ,PARALLELISM => 0
    ,ATOMIC_REFRESH => TRUE
    ,NESTED => FALSE);
    END;
    I would like to Refresh it with PARALLELISM => 8 , and after the rebuild will finish
    i want to set it back to serial (e.g: PARALLELISM => 0).
    Is there an ALTER command that i can use ?
    Please explain how to do that.
    Thanks.

    For the specific 10g case of
    BEGIN
    DBMS_SNAPSHOT.REFRESH(
    LIST => 'XYZ_DETAIL'
    ,METHOD => 'C'
    ,PUSH_DEFERRED_RPC => TRUE
    ,REFRESH_AFTER_ERRORS => FALSE
    ,PURGE_OPTION => 1
    ,PARALLELISM => 0
    ,ATOMIC_REFRESH => TRUE
    ,NESTED => FALSE);
    END;
    and using PARALLELISM of 8 for a specific refresh
    can you tell us what are the differences in Materialized Views , say between
    10gR1 and 10gR2 if you can't tell us the differences between 8i and 10g ?
    Message was edited by:
    Hemant K Chitale

  • Getting ORA-06508 when running 6i form in 10g

    hi,
    I am upgrading my forms from 6i to 10g. I have created the following directory structure on my system.
    c:\old_system\<module_name>\<forms60> --- All FMBs and FMXs
    c:\old_system\<module_name>\<lib> --- All libraries
    c:\old_system\<module_name>\<reports60> ---All Reports
    c:\10g_upgrade\<module_name>\<forms60> --- All FMBs and FMXs
    c:\10g_upgrade\<module_name>\<lib> --- All libraries
    c:\10g_upgrade\<module_name>\<reports60> ---All Reports
    i have edited the registery entry for
    for forms6i
    Forms60_PATH --- c:\old_system\<module_name>\<lib>
    for forms10g
    Forms_PATH -- c:\10g_upgrade\<module_name>\<lib>
    I have two template forms:
    1. TMXSTAND.FMB
    2. PPSSTAND.FMB inherits TMXSTAND.FMB
    when i run the FPPS003.FMB then it gives this error.
    ON-ERROR raised an unhandled exception ORA-06508.
    Please suggest where is the problem.
    Thanks.
    null

    I have given the proper path of the library folder in Forms_Path. Still I am getting this error...
    Is this error because of having both the versions of forms (6i and 10g)?
    Message was edited by:
    gammit

  • UTL_MAIL:  Send_Attach_Raw / Attachement-Size?

    Just two simple question :-)
    I want to use the UTL_Mail Package from 10g to send emails with attachements.
    Question 1: Can I attach more than one attachment or must I "zip" the files to one file before I can use the package?
    Question 2: What is the maximum size for an attachement?
    The input-parameter for the attachement in the Send_Attach_Row Procedure is of datatype RAW.
    Does this mean an attachement can not be > 32K ???
    If not, how can I send attachements > 32K ???
    Regards
    Udo

    I've not looked at the 10g UTL_MAIL package yet, but I use the UTL_SMTP package provided with 9i (probably also available in 10g). On OTN ther's a demo mail package available which you can alter after studying it. I've added/modified a procedure to that package:
    /* Write a binary attachment (BLOB) */
    PROCEDURE ATTACH_BASE64
    (P_CONN      IN OUT NOCOPY UTL_SMTP.connection
    ,P_DATA      IN BLOB
    ,P_MIME_TYPE IN VARCHAR2 := 'application/octet'
    ,P_INLINE    IN BOOLEAN := TRUE
    ,P_FILENAME  IN VARCHAR2 := NULL
    ,P_LAST      IN BOOLEAN := FALSE
    IS
       i            PLS_INTEGER;
       len          PLS_INTEGER;
    BEGIN
       BEGIN_ATTACHMENT(p_conn, p_mime_type, p_inline, p_filename, 'base64');
       -- Split the Base64-encoded attachment into multiple lines
       i   := 1;
       len := DBMS_LOB.getLength(p_data);
       WHILE (i < len) LOOP
          IF(i + MAX_BASE64_LINE_WIDTH < len)THEN
             UTL_SMTP.Write_Raw_Data (p_conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_data, MAX_BASE64_LINE_WIDTH, i)
          ELSE
             UTL_SMTP.Write_Raw_Data (p_conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_data, (len - i),  i)
          END IF;
          UTL_SMTP.Write_Data(p_conn, UTL_TCP.CRLF);
          i := i + MAX_BASE64_LINE_WIDTH;
       END LOOP;
       END_ATTACHMENT(p_conn, p_last);
    END;As you can see you will need the demo mail package. You can call this procedure to add several binary attachments with no limit. And I'm sure you somehow can put this in use with the new UTL_MAIL package.
    Hope this helps,
    Michiel

  • Email from form

    Hi I am using 10g forms .
    I have installed
    @c:\DevSuiteHome_1\rdbms\admin\utlmail.sql
    @c:\DevSuiteHome_1\rdbms\admin\prvtmail.plb
    with no errors.
    then
    ALTER SYSTEM SET smtp_out_server = xyz/abd/mnc.com'SCOPE=SPFILE;
    xyz/abd/mnc = my email id. i am using lotus notes as default company email service.
    O nthe form i have created a button with code
    declare
    begin
    utl_mail.send(
    sender => 'my email.com',
    recipients => 'something.com',
    subject => 'Testing utl_mail',
    message => 'The receipt of this email means FOR UTL_MAIL ');
    END;
    WHEN I CLICK THE BUTTON NOTHING HAPPENS !
    what am i missing here ??
    plz help i am stuck at this for lonnnng time now .
    cheers

    Hey buddy,
    I was working on a similar issue today.
    1. Set the SMT_OUT_SERVER in init.ora and shutdown the server and started
    using this init.ora
    2. Checked by logging as sys whether utl_mail package is valid
    3 From the sys account I tried sending the email
         BEGIN
         utl_mail.send('[email protected]', '[email protected]', NULL,      NULL, NULL);
         END ;
    4 If step 3 works ur set up is good and then you need to have the privilege for
    the user account where you are running this or grant it to public
    grant execure on utl_mail to public
    Rajesh Alex

  • Send mail alert

    Hi All, does anyone know how to send mail alert from windows box when oracle is down ?
    I have oracle 10.2.0.4 running on windows 2000 server and wanted to wrote a script in windows to detect if oracle is down, it will send mail alert to my mailbox.
    Is there any command line interface to call the send mail function in windows ?
    Pls advice how i can do this.
    Thanks.

    In order to send email within 10g you must install and set up the UTL_MAIL package.
    UTL_MAIL isn't installed when the database is installed because the SMTP_OUT_SERVER parameter must be configured. Listing 1 shows how to install UTL_MAIL and the results from the script. You must connect to the database as user SYS and run the two scripts identified in the listing.
    Listing 1. Installation of UTL_MAIL
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    No errors. Next, the SMTP_OUT_SERVER parameter must be configured. You must connect to SYS and then use the alter system command to configure SMTP_OUT_SERVER parameter as shown here:
    SQL> alter system set smtp_out_server = '<ip-address:port' scope=Both;
    System altered.That's it! The installation and setup for UTL_MAIL is complete. The UTL_MAIL package only has one procedure, called Send, for sending email (see Listing 2 for the syntax for the Send procedure). This package bundles the email message and sends it to the UTL_SMTP package, and then the email message is sent to the SMTP server.
    Listing 2. Syntax for UTL_MAIL.SEND
    UTL_MAIL.SEND( sender IN VARCHAR2,
                                     recipients IN VARCHAR2,
                                    cc IN VARCHAR2 DEFAULT NULL,
                                    bcc IN VARCHAR2 DEFAULT NULL,
                                    subject IN VARCHAR2 DEFAULT NULL,
                                    message IN VARCHAR2,
                                    mime_type IN VARCHAR2 DEFAULT
                                    'text/plain; charset=us-ascii',
                                    priority IN PLS_INTEGER DEFAULT  NULL);
    Examples: I've created a database trigger that will send an email using UTL_MAIL (see Listing 3).
    Listing 3. Database shutdown using UTL_MAIL
    CREATE OR REPLACE TRIGGER SCOTT.db_shutdown
    before shutdown on database
    begin
    utl_mail.send(
       sender => '[email protected]',
       recipients => ' [email protected]',
       subject => 'Testing utl_mail',
       message => 'The receipt of this email means'||
        ' that shutting down the database'||
        ' works for UTL_MAIL '
    end;
    /

Maybe you are looking for