Webutil error while using Outlook
Hi..
Iam trying to send a mail from my form (forms 10G).
I can actually able to send the mail from the form but i also get an error like this.
"WUO-705: Unable to invoke method: Send; Exception
com.jacob.com.ComFailException:
VariantChangeType Failed"
This is the code i used:
PROCEDURE send_word_req IS
v_to varchar2(100) ;
v_cc VARCHAR2(100);
v_bcc VARCHAR2(1);
v_subject varchar2(100) := 'Test mail from Form Using Client_OLE2';
v_body varchar2(100) := 'Hi...This mail is to test sending a mail from Forms using webutil. ';
OutlookApp client_ole2.OBJ_TYPE;
NameSpace client_ole2.OBJ_TYPE;
Folders client_ole2.OBJ_TYPE;
MailItem client_ole2.OBJ_TYPE;
OLEPARAM client_ole2.list_type;
Send client_ole2.OBJ_TYPE;
Attachments client_ole2.OBJ_TYPE;
Attachment_dummy client_ole2.OBJ_TYPE;
begin
OutlookApp := client_ole2.CREATE_OBJ('Outlook.Application');
v_to := 'xyz@yahoo.com';
-- Create a namespace
-- Think of this as the equivalent as the Documents Collection
OLEPARAM := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := client_ole2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
client_ole2.DESTROY_ARGLIST( OLEPARAM );
--Create a newMail Object
OLEPARAM := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(OLEPARAM,0);
MailItem := client_ole2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
client_ole2.DESTROY_ARGLIST( OLEPARAM );
client_ole2.set_property(MailItem,'To',v_to);
client_ole2.set_property(MailItem,'Subject',v_subject);
client_ole2.set_property(MailItem,'Body',v_body);
Send := client_ole2.INVOKE_OBJ(Mailitem,'Send');
client_ole2.RELEASE_OBJ( MailItem);
client_ole2.RELEASE_OBJ( NameSpace );
client_ole2.RELEASE_OBJ( OutlookApp );
Message('Mail send successfully...');
END;
Plz help me in this regard.
Thanx in advance
Sriram