Sending E-mail from Oracle

Hi,
I written the below email procedure.I am facing an issues now. I am receving the mail but it does not have any content.
CREATE OR REPLACE PROCEDURE IIBWP.SEND_MAIL
is
l_mailhost VARCHAR2(64) := 'us.ingerrand.com';
l_from VARCHAR2(64) := '[email protected]';
l_subject VARCHAR2(64) := 'Duplicate records details';
l_to VARCHAR2(64) := '[email protected]';
l_mail_conn UTL_SMTP.connection;
v_cnt number;
cursor c1 is select * from error_log_table where trunc(error_timestamp) =trunc(sysdate);
BEGIN
select count(*) into v_cnt
from error_log_table
where trunc(error_timestamp) =trunc(sysdate);
--if v_cnt>=1 then
l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
UTL_SMTP.helo(l_mail_conn, l_mailhost);
UTL_SMTP.mail(l_mail_conn, l_from);
UTL_SMTP.rcpt(l_mail_conn, l_to);
utl_smtp.data(l_mail_conn, 'CHINNATHAMBI');
UTL_SMTP.open_data(l_mail_conn);
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || Chr(13));
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'From: ' || l_from || Chr(13));
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'Subject: ' || l_subject || Chr(13));
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'To: ' || l_to || Chr(13));
UTL_SMTP.write_data(l_mail_conn, '' || Chr(13));
FOR i IN c1 LOOP
UTL_SMTP.write_data(l_mail_conn, i.error_details);
END LOOP;
UTL_SMTP.close_data(l_mail_conn);
UTL_SMTP.quit(l_mail_conn);
--end if;
END;
Please help me to fix this issues.
the mail which i received is only having the from email address. it is not showing the to mail address, and the messages.
with regards
chinnathambi

user607786 wrote:
I written the below email procedure.I am facing an issues now. I am receving the mail but it does not have any content.Invalid Mime body is created by your code.
UTL_SMTP.helo(l_mail_conn, l_mailhost);Not really correct (soft error, usually ignored by SMTP server). You need to define your IP host in the HELO command - not pass the mail server its hostname.
utl_smtp.data(l_mail_conn, 'CHINNATHAMBI');
UTL_SMTP.open_data(l_mail_conn);Huh? The DATA command is intended to use a single call to send the entire e-mail (headers and body). This contains the text string "+CHINNATHAMBI+". This is not valid.
The document describes this call as follows:
UTL_SMTP.DATA (
   c     IN OUT NOCOPY connection
   body  IN VARCHAR2 CHARACTER SET ANY_CS);
Parameter      Description
c               The SMTP Connection.
body            The text of the message to be sent, including headers, in [RFC822] format.Is that string in RFC822 format? Nope - not even close.
Then straight after that, you now use multiple commands to create another e-mail body... This is not a valid SMTP command sequence. You have already supplied complete e-mail data - you cannot now supply yet more e-mail data!
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || Chr(13));
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'From: ' || l_from || Chr(13));
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'Subject: ' || l_subject || Chr(13));
UTL_SMTP.write_data(l_mail_conn, UTL_TCP.CRLF ||'To: ' || l_to || Chr(13));
UTL_SMTP.write_data(l_mail_conn, '' || Chr(13));Also wrong. Here you are attempting to write an e-mail header. There should not be an empty line as the first line - as an empty line is used to separate the header from the body in the mail.
The header lines must be written first (no empty lines). Then a single empty line to indicate the start of the body. Then the body itself (using local headers per body part if this a mixed multi-type Mime message).
I suggest you first get to grips with how a physical e-mail looks like, before you attempt to manually create one. You can use your mail reader and select the "+view source/raw e-mail+" option to look at the actual physical text structure of e-mails. You should also have a look at the RFC's (Request For Comments) memo's that specifies the Internet standards for Mime bodies, such as RFC822 (Internet Message Format). Use google to look up these RFC's.
Constructing e-mails is easy - but that requires you to know the basic structure of an Internet Message. Not guessing like you have done in your code.

Similar Messages

  • Sending a mail from oracle database

    Hi,
    I have a requirement to send a mail from oracle database.I use UTL_TCP package for this.Although my procedure is executed successfully,i dont get the mails in my inbox.Please help me to figure out a solution.
    Thanks in advance....

    Hi, you must use UTL_SMTP package for send emails, it has more performance and features for debug. You must look the next code, this is a example for send emails.
    DECLARE
    c UTL_SMTP.CONNECTION;
    PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS
    BEGIN
    UTL_SMTP.WRITE_DATA(c, name || ': ' || header || UTL_TCP.CRLF);
    END;
    BEGIN
    c := UTL_SMTP.OPEN_CONNECTION('smtp-server.acme.com');
    UTL_SMTP.HELO(c, 'foo.com');
    UTL_SMTP.MAIL(c, '[email protected]');
    UTL_SMTP.RCPT(c, '[email protected]');
    UTL_SMTP.OPEN_DATA(c);
    send_header('From', '"Sender" <[email protected]>');
    send_header('To', '"Recipient" <[email protected]>');
    send_header('Subject', 'Hello');
    UTL_SMTP.WRITE_DATA(c, UTL_TCP.CRLF || 'Hello, world!');
    UTL_SMTP.CLOSE_DATA(c);
    UTL_SMTP.QUIT(c);
    EXCEPTION
    WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
    BEGIN
    UTL_SMTP.QUIT(c);
    EXCEPTION
    WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN
    NULL; -- When the SMTP server is down or unavailable, we don't have
    -- a connection to the server. The QUIT call will raise an
    -- exception that we can ignore.
    END;
    raise_application_error(-20000,
    'Failed to send mail due to the following error: ' || sqlerrm);
    END;
    Also review the next link for get more information about the UTL_SMTP packege.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_smtp.htm#sthref15587
    Regards.

  • How a send a mail from  Oracle   ----- urgent

    Hi,
    I am working in oracle9i and linux 2.4. i need to a send mail from oracle .Please send the procedure to me in a detail manner.
    I am having one procedure .plz check and change if possible...
    declare
    l_maicon utl_smtp.connection;
    begin
    l_maicon :=utl_smtp.open_connection('mail.com');
    utl_smtp.helo(l_maicon,'mail.com');
    utl_smtp.mail(l_maicon,'[email protected]');
    utl_smtp.rcpt(l_maicon,'[email protected]');
    utl_smtp.data(l_maicon,'From: [email protected]' || utl_tcp.crlf||
    'To: [email protected]' || utl_tcp.crlf ||
    'Subject: database e-mail option' || utl_tcp.crlf ||
    'You have received this mail from database!');
    utl_smtp.quit(l_maicon);
    end;
    Please explain me in detail
    Gobi....

    If I do a Google search on the terms "Oracle mail", this askTom thread is the second hit
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:255615160805
    Did you already find this thread? If so, did it not answer your question sufficiently?
    Additionally, it would be quite helpful if you would post the results of running the code you posted. You've given no indication whether there is an error, what error might be generated, whether you're not seeing the expected behavior, whether the code crashes your system, etc. That leaves us to guess about what problems you might have between syntax errors, permission problems, configuration problems on the database, configuration problems on the SMTP server, operating system problems, network problems (the list goes on).
    Justin

  • Send e-mail from oracle forms

    how can i send e-mail from within the form and without opening any e-mail program
    just one click on a button in the form the mail will be sent
    i'm working on nt os

    I use a program called BLAT which is a command line utility to send SMTP messages.
    ( Use the HOST built-in ).
    I tried using MAPI products but they did not work well on the web.
    null

  • 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

  • Send e-mail from Oracle 9i (9.2.0.1)

    Hi,
    Iam using oracle 9iR2(9.2.0.1) on Widows XP Platform. I want to send mail thru oracle 9i(9.2.0.1) database.
    for that i got a procedure from net. Also they asked to follow three steps. the steps are
    1. Execute the script as sys "D:\Oracle\Ora92\javavm\install\initjvm.sql"
    2. Execute the loadjava classfile as
    D:\Oracle\Ora92\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 i am 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
    Regards
    Prasanta Pramanik.

    Is there some reason not to use the built-in UTL_SMTP package?
    http://www.psoug.org/reference/utl_smtp.html
    It has been available since 8.1.7.

  • How to Send a Mail From the Oracle Applications.

    Hi,
    I was assigned a task to send a mail from the front end i.e., from oracle applications.
    but i have no idea.
    i am working on oracle apps R12.1.1 and 10g reports.
    First i have to create an rdf file and that rdf file i want to send as an attachment through mail from the apps.
    Any Advice will be of great help and i will follow accordingly.
    Thanks in Advance,
    Regards,
    Bharathi.S

    Hi,
    I was assigned a task to send a mail from the front end i.e., from oracle applications.
    but i have no idea.
    i am working on oracle apps R12.1.1 and 10g reports.
    First i have to create an rdf file and that rdf file i want to send as an attachment through mail from the apps.
    Any Advice will be of great help and i will follow accordingly.
    Thanks in Advance,
    Regards,
    Bharathi.S

  • Send mail from oracle database 10g

    Hi ,
    I need to send a test mail from oracle database 10g to my gmail account through a stored procedure .
    I will pass the list of recipents , subject and text of the mail through parameters .
    Can anyone give me the code of the storerd procedure please ,
    Thank you .

    hi, for example
    DECLARE
    mail_conn UTL_SMTP.connection;
    smtp_relay VARCHAR2(32) := '172.16.x.x';
    recipient_address VARCHAR2(64) := '[email protected]';
    sender_address VARCHAR2(64) := '[email protected]';
    mail_port NUMBER := 25;
    msg VARCHAR2(200);
    BEGIN
    mail_conn := UTL_SMTP.open_connection(smtp_relay,mail_port);
    UTL_SMTP.HELO(mail_conn, smtp_relay);
    UTL_SMTP.MAIL(mail_conn, sender_address);
    UTL_SMTP.RCPT(mail_conn, recipient_address);
    UTL_SMTP.DATA(mail_conn, 'Payment request iniated');
    UTL_SMTP.QUIT(mail_conn);
    end;

  • How to send mails from Oracle database

    Hi All,
    I want to send a mail from my oracle database once my store
    procedure runs successfully or fails.
    How can i do this.
    what are the preliminary modules of Oracle which need to be
    active for me to do so.
    If any once can also mention about any links that give
    information about the same it will be very helpful for me.
    Thanks and Regards
    Srinivas Chebolu

    CREATE OR REPLACE PROCEDURE SEND_MAIL_TCP(
    msg_from varchar2 := '[email protected]',
    msg_to varchar2,
    msg_subject varchar2 := 'E-Mail message from your database',
    msg_text varchar2 := '' )
    IS
    c utl_tcp.connection;
    rc integer;
    BEGIN
    c := utl_tcp.open_connection('1.17.0.218', 25); -- open the SMTP
    port 25 on local machine
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'HELO localhost');
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'MAIL FROM: '||msg_from);
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'RCPT TO: '||msg_to);
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'DATA'); -- Start message body
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'Subject: '||msg_subject);
    rc := utl_tcp.write_line(c, '');
    rc := utl_tcp.write_line(c, msg_text);
    rc := utl_tcp.write_line(c, '.'); -- End of message body
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'QUIT');
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    utl_tcp.close_connection(c); -- Close the connection
    EXCEPTION
    when others then
    raise_application_error(-20000,'Unable to send e-mail message
    from pl/sql');
    END;
    show errors
    exec send_mail(msg_to =>'[email protected]');
    exec send_mail(msg_to
    =>[email protected]',msg_text=>'Look Yaar, I can send
    mail from plsql');

  • Sending mail from oracle procedure

    Hi Experts,
    I want to send mail from oracle Procedure. Anybody please help me out.
    Thanks.

    BEGIN
    UTL_MAIL.send(sender => '[email protected]',
    recipients => '[email protected],[email protected]',
    cc => '[email protected]',
    bcc => '[email protected]',
    subject => 'UTL_MAIL Test',
    message => 'If you get this message it worked!');END;

  • Send a mail from report 6i with his function "mail...."

    I have tried to send a mail from report using "File" ---> "Mail.." Function that is avaible on report, but it send a file "*.eps" that is not readble with the normal reader.....
    It is possible to send a PDF file ???
    Thank 's .....
    il vampiro

    Hello Mike,
    In Reports Builder 6i, Just change the Initial Value of the DESFORMAT System Parameter in the Object Navigator (under Data Model) to PDF, or any other format you want to mail the report in.
    Thanks,
    The Oracle Reports Team.

  • How to send a mail thru Oracle

    Hello Every one ,
    Can u plz tell me the way to send a mail thru oracle...................

    Follow the below steps..........
    INTRODUCTION:
    This bulletin explains how to programmatically send a fax/email message from a
    Forms/Reports application via Microsoft Exchange without any kind of user
    interaction. It shows the general usage of the 'Mail' package as well as a fully
    coded Forms sample application.
    The concept of OLE (Object Linking and Embedding) automation is used to control
    the OLE server application (Microsoft Exchange) using the client application.
    The client in this case may be a Developer/2000 Forms or Reports application. It
    uses the objects and methods exposed by the OLE Messaging Library which are
    much more robust than the MSMAPI OCX controls and allow access to many more MAPI
    properties.
    Oracle provides support for OLE automation in its applications by means of the
    OLE2 built-in package. This package contains object types and built-ins for
    creating and manipulating the OLE objects. Some of these built-ins for e.g.
    OLE2.create_obj, OLE2.invoke, OLE2.set_property have been extensively used in
    the code.
    GENERAL USAGE:
    The Mail package contains three procedures:
    1. Procedure Mail_pkg.logon( profile IN varchar2 default NULL);
    Use this procedure to logon to the MS Exchange mail client. The procedure
    takes a character argument which specifies the Exchange Profile to use for
    logon. Passing a NULL argument to the logon procedure brings up a dialog box
    which asks you to choose a profile from a list of valid profiles or create a new
    one if it doesn't exist.
    2. Procedure Mail_pkg.send(
    --------- Recipient IN varchar2,
    Subject IN varchar2 default NULL,
    Text IN varchar2 default NULL,
    Attachment IN varchar2 default NULL
    This is the procedure that actually sends the message and attachments, if
    any, to the recipient. The recipient may be specified directly as a valid email
    address or as an alias defined in the address book. If the message is intended
    for a fax recipient then a valid alias must be used that is defined as a fax
    address in the address book.
    3. Procedure Mail_pkg.logoff;
    This procedure closes the Exchange session and deallocates the resources used
    by the OLE automation objects.
    SAMPLE FORMS APPLICATION:
    1. Create the Mail Package using the following two Program Units:
    (a) Mail Package Spec
    (b) Mail Package Body
    Mail Package Spec:
    PACKAGE Mail_pkg IS
    session OLE2.OBJ_TYPE; /* OLE object handle */
    args OLE2.LIST_TYPE; /* handle to OLE argument list */
    procedure logon( Profile IN varchar2 default NULL );
    procedure logoff;
    procedure send( Recp IN varchar2,
    Subject IN varchar2,
    Text IN varchar2,
    Attch IN varchar2
    END;
    Mail Package Body:
    PACKAGE BODY Mail_pkg IS
    session_outbox OLE2.OBJ_TYPE;
    session_outbox_messages OLE2.OBJ_TYPE;
    message1 OLE2.OBJ_TYPE;
    msg_recp OLE2.OBJ_TYPE;
    recipient OLE2.OBJ_TYPE;
    msg_attch OLE2.OBJ_TYPE;
    attachment OLE2.OBJ_TYPE;
    procedure logon( Profile IN varchar2 default NULL )is
    Begin
    session := ole2.create_obj('mapi.session');
    /* create the session object */
    args := ole2.create_arglist;
    ole2.add_arg(args,Profile);/* Specify a valid profile name */
    ole2.invoke(session,'Logon',args);
    /* to avoid the logon dialog box */
    ole2.destroy_arglist(args);
    End;
    procedure logoff is
    Begin
    ole2.invoke(session,'Logoff');
    /* Logoff the session and deallocate the */
    /* resources for all the OLE objects */
    ole2.release_obj(session);
    ole2.release_obj(session_outbox);
    ole2.release_obj(session_outbox_messages);
    ole2.release_obj(message1);
    ole2.release_obj(msg_recp);
    ole2.release_obj(recipient);
    ole2.release_obj(msg_attch);
    ole2.release_obj(attachment);
    End;
    procedure send( Recp IN varchar2,
    Subject IN varchar2,
    Text IN varchar2,
    Attch IN varchar2
    )is
    Begin
    /* Add a new object message1 to the outbox */
    session_outbox := ole2.get_obj_property(session,'outbox');
    session_outbox_messages := ole2.get_obj_property(session_outbox,'messages');
    message1 := ole2.invoke_obj(session_outbox_messages,'Add');
    ole2.set_property(message1,'subject',Subject);
    ole2.set_property(message1,'text',Text);
    /* Add a recipient object to the message1.Recipients collection */
    msg_recp := ole2.get_obj_property(message1,'Recipients');
    recipient := ole2.invoke_obj(msg_recp,'add') ;
    ole2.set_property(recipient,'name',Recp);
    ole2.set_property(recipient,'type',1);
    ole2.invoke(recipient,'resolve');
    /* Add an attachment object to the message1.Attachments collection */
    msg_attch := ole2.get_obj_property(message1,'Attachments');
    attachment := ole2.invoke_obj(msg_attch,'add') ;
    ole2.set_property(attachment,'name',Attch);
    ole2.set_property(attachment,'position',0);
    ole2.set_property(attachment,'type',1); /* 1 => MAPI File Data */
    ole2.set_property(attachment,'source',Attch);
    /* Read the attachment from the file */
    args := ole2.create_arglist;
    ole2.add_arg(args,Attch);
    ole2.invoke(attachment,'ReadFromFile',args);
    ole2.destroy_arglist(args);
    args := ole2.create_arglist;
    ole2.add_arg(args,1); /* 1 => save copy */
    ole2.add_arg(args,0); /* 0 => no dialog */
    /* Send the message without any dialog box, saving a copy in the Outbox */
    ole2.invoke(message1,'Send',args);
    ole2.destroy_arglist(args);
    message('Message successfully sent');
    End;
    END;
    2. Create a block called MAPIOLE with the following canvas layout:
    |-------------------------------------------------------------|
    | |
    | Exchange Profile: |====================| |
    | |
    | To: |============================| |
    | |
    | Subject: |============================| |
    | |
    | Message: |============================| |
    | | | |
    | | | |
    | | | |
    | | | |
    | | | |
    | |============================| |
    | |-----| |
    | Attachment: |============================| |SEND | |
    | |-----| |
    |-------------------------------------------------------------|
    The layout contains 5 text-itmes:
    - Profile
    - To
    - Subject
    - Message (multiline functional property set to true)
    - Attach
    and a 'Send' button with the following WHEN-BUTTON-PRESSED trigger:
    mail_pkg.logon(:profile);
    mail_pkg.send(:to,:subject,:message,:attch);
    mail_pkg.logoff;

  • Sending E-mail Through Oracle Forms

    Hi all
    what i want is as the following:
    1- i would like to convert the report to the PDF file internally using code.
    2- open the outlook.
    3- attcah the PDF automatically to the e-mail.
    4- finally sending the e-mail though outlook
    could i do that in Oracle forms 6i if i could do that can anyone instruct me to do it step by step

    Oh...it's now called ["My Oracle Support"|https://metalink.oracle.com/] .
    There's a note on "My Oracle Support" on this item.
    This is the note:
    Subject:      OLE AUTOMATION: Example Sending a Mail From Forms to Outlook
           Doc ID:      119828.1      Type:      BULLETIN
           Modified Date :      02-SEP-2008      Status:      PUBLISHED
    PURPOSE
    This document contains a sample code how to send an e-mail from Forms to Outlook
    (97-2000). 
    SCOPE & APPLICATION
    It can be used in addition of the whitepaper "Cracking Outlook!", which explains
    the object model of Outlook in detail.
    (Have a look in the Technical Libaries Folder Forms Whitepaper, their you can
    find it)
    OLE: Forms to Outlook
    Object Model
    "Cracking outlook!" explains the Object Model, you can find additional
    information in the Visual Basic Help of Outlook, which must be installed from
    your Office CD-Rom.  Once installed, you can access the help
    by choosing Tools->Macro->Visual Basic Editor and then go to the Help or
    Object Browser (view -> Object Browser)
    Now you can retrieve the Objects, their Methods and Properties. 
    Eg: the 'Application' Object has the Method 'CreateItem'.
    Note this information is also available in MSDN library or if you require more
    information on this Microsoft has to be contacted.
    OLE2, CLIENT_OLE2 Package
    Once you know the Objects, Methods and Properties you can access them with the
    OLE2 package.  This package provides a PL/SQL API for creating, manipulating,
    and accessing attributes of OLE2 automation objects.  When using OLE2 with
    WebForms every call will be executed on the midtier and not on the client. 
    So alternatively, the CLIENT_OLE2 package can be used, that is delivered by
    Webutil, to execute the OLE code on the client.
    Examples
    Once you know the Outlook Object model and you know the functions of the OLE2
    or CLIENT_OLE2 package you can write your own OLE2/CLIENT_OLE2 code to send a
    mail via Outlook.
    Here below are 2 different ways of sending an email using Outlook. 
    Sample 1:
    OLE2 sample: Here a MailItem is created, then the Recepient is explicitely
    added and resolved.  The mailItem is saved before being sent.
    Declare
    /*declaration of the Outlook Object Variables*/
    application ole2.OBJ_TYPE;     
    hMailItem ole2.OBJ_TYPE;
    hRecipients ole2.OBJ_TYPE;
    recipient ole2.OBJ_TYPE;
    nameSpace OLE2.OBJ_TYPE;
    /*declaration of the argument list*/ 
    args OLE2.LIST_TYPE;          
    begin
    /*create the Application Instance*/
    application:=ole2.create_obj('Outlook.Application');          
    /* create namespace and login */
    args:=ole2.create_arglist;
    ole2.add_arg(args,'MAPI');
    nameSpace:=ole2.invoke_obj(application,'getNameSpace',args);
    ole2.destroy_arglist(args);
    ole2.invoke(nameSpace,'Logon');
    /*create a Mail Instance by calling CreateItem Method and giving argument 0 with
    it,
    you can find the item types in the explanation of the CreateItem Method
    (0=olMailItem,1=olAppointmentItem, ?)*/
    args:=ole2.create_arglist;                         
    ole2.add_arg(args,0);
    hMailItem:=ole2.invoke_obj(application,'CreateItem',args);
    ole2.destroy_arglist(args);
    /*Get the Recipients property of the MailItem object: 
    Returns a Recipients collection that represents all the Recipients for the
    Outlook item*/
    args:=ole2.create_arglist;
    hRecipients:=ole2.get_obj_property(hMailItem,'Recipients',args);
    ole2.destroy_arglist(args);
    /*Use the Add method to create a recipients Instance and add it to the
    Recipients collection*/
    args:=ole2.create_arglist;
    ole2.add_arg(args,'[email protected]');
    recipient:=ole2.invoke_obj(hRecipients,'Add',args);
      /* put the property Type of the recipient Instance  to value needed
    (0=Originator,1=To,2=CC,3=BCC)*/
    ole2.set_property(recipient,'Type',1);
    ole2.destroy_arglist(args);
    /*Resolve the Recipients collection*/
    args:=ole2.create_arglist;
    ole2.invoke(hRecipients,'ResolveAll',args);
    /*set the Subject and Body properties*/
    ole2.set_property(hMailItem,'Subject','Test OLE2 to Outlook');
    ole2.set_property(hMailItem,'Body','this is body text');
    /*Save the mail*/
    ole2.invoke(hMailItem,'Save',args);
    ole2.destroy_arglist(args);
    /*Send the mail*/
    args:=ole2.create_arglist;
    ole2.invoke(hMailItem,'Send',args);
    ole2.destroy_arglist(args);
    /*Release all your Instances*/
    release_obj(hMailItem);
    release_obj(recipient);
    release_obj(hRecipients);
    release_obj(nameSpace);
    release_obj(application);
    end;
    Sample 2
    CLIENT_OLE2 sample.  Here a MailItem is created with an attachment and directly
    sent.
    Declare
    objOutlook CLIENT_OLE2.OBJ_TYPE;
    objMail CLIENT_OLE2.OBJ_TYPE;
    objArg CLIENT_OLE2.LIST_TYPE;
    objAttach CLIENT_OLE2.OBJ_TYPE;
    nameSpace CLIENT_OLE2.OBJ_TYPE;
    BEGIN
    objOutlook := CLIENT_OLE2.CREATE_OBJ('Outlook.Application');
    /* create namespace and login */
    args:=client_ole2.create_arglist;
    client_ole2.add_arg(args,'MAPI');
    nameSpace:=ole2.invoke_obj(objOutlook,'getNameSpace',args);
    client_ole2.destroy_arglist(args);
    client_ole2.invoke(nameSpace,'Logon');
    -- Previous example usually used 'mapi.session' but this doesn't work correctly
    --anymore.
    objarg := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(objarg,0);
    objMail := CLIENT_OLE2.INVOKE_OBJ(objOutlook,'CreateItem', objarg);
    CLIENT_OLE2.DESTROY_ARGLIST(objarg);
    objAttach := CLIENT_OLE2.GET_OBJ_PROPERTY(objmail, 'Attachments');
    objarg := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(objarg,'c:\temp\test.txt'); -- filename
    CLIENT_OLE2.SET_PROPERTY(objmail,'To','[email protected]');
    CLIENT_OLE2.SET_PROPERTY(objmail,'Subject','Email sent from Oracle Forms 9i');
    CLIENT_OLE2.SET_PROPERTY(objmail,'Body','This is an email that was sent using
    CLIENT_OLE2 from Oracle forms 9i');
    CLIENT_OLE2.INVOKE(objattach, 'Add', objarg);
    CLIENT_OLE2.INVOKE(objmail,'Send');
    CLIENT_OLE2.RELEASE_OBJ(objmail);
    CLIENT_OLE2.RELEASE_OBJ(nameSpace);
    CLIENT_OLE2.RELEASE_OBJ(objOutlook);
    CLIENT_OLE2.DESTROY_ARGLIST(objarg);
    END;
    Notes:
    These are just 2 different ways of sending a mail by Outlook and using the
    Outlook Object Model.
    The first example can also be used with CLIENT_OLE2, and the second example can
    also be used with OLE2.
    (just replace every OLE2 to CLIENT_OLE2 or every CLIENT_OLE2 call to OLE2).

  • Send a mail from forms10g

    Respected guru's,
    Can u plez guid me how how i send a mail from forms 10g??
    Edited by: user651567 on Mar 7, 2009 10:27 AM

    If you have a mail-client installed on the client-pc you could use the following to open it and iinitially create a mail with that microsoft outlook express connectivity to oracle
    If you have Outlook installed as mail-client another option would be CLIENT_OLE in webutil, have a look at this Send mail with attachment

  • Urgent - Mail from Oracle

    Dear friends,
    I want 2 send mail from Oracle PL/SQL . I have used the
    following code to send mail.
    create or replace PROCEDURE send_mail_1 (sender IN VARCHAR2,
    recipient IN VARCHAR2,
    message IN VARCHAR2)
    IS
    mailhost VARCHAR2(30) := 'mailhost.mydomain.com';
    smtp_error EXCEPTION;
    mail_conn utl_tcp.connection;
    PROCEDURE smtp_command(command IN VARCHAR2,
    ok IN VARCHAR2 DEFAULT '250')
    IS
    response varchar2(3);
    x number;
    BEGIN
    x:= utl_tcp.write_line(mail_conn, command);
    response := substr(utl_tcp.get_line(mail_conn), 1, 3);
    IF (response <> ok) THEN
    RAISE smtp_error;
    END IF;
    END;
    BEGIN
    mail_conn := utl_tcp.open_connection(mailhost, 25);
    smtp_command('HELO ' || mailhost);
    smtp_command('MAIL FROM: ' || sender);
    smtp_command('RCPT TO: ' || recipient);
    smtp_command('DATA', '354');
    smtp_command(message);
    smtp_command('QUIT', '221');
    utl_tcp.close_connection(mail_conn);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLERRM);
    END;
    I am able to successfuly create the procedure. But while
    executing the procedure I got the following error "ORA-29540:
    class oracle/plsql/net/TCPConnection does not exist".
    I have used the following format while I tried executing the
    procedure
    execute send_mail_1
    ('[email protected]','[email protected]','Test')
    Are the above parameters are correct?. Further should I need to
    change 'mailhost.mydomain.com' string value?- If yes what value
    should be given there?
    mailhost VARCHAR2(30) := 'mailhost.mydomain.com';
    Kindly help me in this regards.
    Thanks in advance
    Narayanan

    Something like:
    Create or Replace  Procedure Send_Reminder IS
      CURSOR cur_reminders_needed IS
      SELECT *
      FROM mytable
      where trunc(reminder_date) = trunc(sysdate)
      FOR UPDATE OF reminder_date;
    BEGIN
      For rec in cur_reminders_needed LOOP
        my_mail_pkg.send_emal(rec.stuff_from_my_table);
        UPDATE mytable set reminder_date = reminder_date+rec.reminder_increment
        WHERE CURRENT OF cur_reminders_needed;
      END LOOP;
      COMMIT;
    END;Then use dbms_job.submit to create a job that runs send_reminders every day.
    Then take a nap, Oracle will do everything else.

Maybe you are looking for

  • Nav bar problems; please help.

    Home Birthday Anniversary For Her For Him For Mom For Dad Just Because Making Up Can anyone help?  This is the html for my nav bar, but when I "view in browser" I get a cannot display page message.

  • Optical drive makes weird noise when CD/DVD is inserted, won't play

    OK so...When I put a CD or a DVD into the optical drive, it makes this weird consistant sound that, while i feel like an idiot typing it out, sounds something like: eee ooh ooh eee ooh ohh eee ooh ooh. It does this for a couple minutes until it respo

  • Conversion Agent 7.1 - SP06

    Hi SDN members, While looking at the service mareket place , I have noticed that there is only a SP05 for CONVERSION AGENT 7.1 and non for SP06. Can anyone ellaborate on the subject? Regards, Nirmod.g

  • What exactly does refreshObject do?

    Further to the discussion re "Cache synchronisation via events acrsoss multiple clients" (Cache synchronisation via events acrsoss multiple clients it would be most helpful if someone could explain exactly what happens when session.refreshObject(obje

  • How to create Service and response profiles

    Hello Gurus           I have configured the IC Web Client in solution manager 4.0 system. But in sservice ticket i am not able to see the SLA info. Please tell me   where to give these SLA parameters ?   How to create service and response profiles?