Problem : Send email through Mircosoft Outlook from Oracle Forms 6i

Problem : Send email through Mircosoft Outlook from Oracle Forms 6i

I am using oracle Forms 6i and oracle 8.

I have a Form Named “Customer Info…”. In this form, there are Nine Columns. One of these is Email_address.

Sometimes I need to email these customers. Is there any solution if I click email address field from forms of any customer and after clicking it, MS Outlook New Message starts with desired email address in “To” address field?

Please give me response at your earlist.


Solution: Send email through Mircosoft Outlook from Oracle Forms 6i

This metalink article explains how to send a E-Mail from Forms 6i with the ORA_JAVA package :
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=131980.1

If you want to use OLE2 to send the emails, here is an example :

Declare

/*declaration of the Outlook Object Variables*/
application ole2.OBJ_TYPE;
hMailItem ole2.OBJ_TYPE;
hRecipients ole2.OBJ_TYPE;
recipient ole2.OBJ_TYPE;

/*declaration of the argument list*/
args OLE2.LIST_TYPE;
begin

/*create the Application Instance*/
application:=ole2.create_obj(‘Outlook.Application’);

/*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,’test.name@oracle.com’);
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(application);
release_obj(hRecipients);
release_obj(recipient);
release_obj(hMailItem);

end;