Existe otra manera, usando el Outlook de Microsoft o con el package ORA_JAVA.
Te mando un ejemplo de cómo enviar mails desde Forms con Outlook 97 y 2000. Si necesitas algo sobre el ORA_JAVA dímelo.
Espero que te sirva.
Un saludo,
Tinoco DBA (tinodba)
----------------------------------------------
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 Helpof 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.
Now you can retrieve the Objects, their Methods and Properties. Eg: the 'Application' Object has the Method 'CreateItem'.
*) 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.
Example
Once you know the Outlook Object model and you know the functions of the OLE2 package you can write your own OLE2 code to send a
Mail via Outlook. This example works when Outlook is started on your machine, when it is not started you get the mail in your Outlook
Outbox.
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,'
[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(application);
release_obj(hRecipients);
release_obj(recipient);
release_obj(hMailItem);
end;
----------------------------------------------