Sending Emails from Forms6i in web environment [message #85395] |
Tue, 22 June 2004 06:17 |
Chirag
Messages: 7 Registered: December 2001
|
Junior Member |
|
|
I have a form with form6i version. When I run this form as stand alone (client server) I am able to send email.
But when I run this form from internet explorer it is giving some error.
Can anybody give me a solution to it so that I can send the email through forms in web environment.
Waiting for an early reply.
Thanks in advance.
|
|
|
|
|
Re: Sending Emails from Forms6i in web environment [message #85408 is a reply to message #85405] |
Wed, 23 June 2004 01:53 |
Chirag
Messages: 7 Registered: December 2001
|
Junior Member |
|
|
My client would be using Microsoft outlook for sending Emails from Forms6i which will be running in WEB.
Please provide me input for the same. This is very much urgently need by our client.
Sample Code what I have used is. This work in Client Server but not when I run the form from web.
DECLARE
var2 varchar2(100);
OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE;
MailItem OLE2.OBJ_TYPE;
OLEPARAM OLE2.LIST_TYPE;
Send OLE2.OBJ_TYPE;
var1 varchar2(100);
Begin
var1 := 'Checking if Mailing program is working';
OutlookApp := OLE2.CREATE_OBJ('Outlook.Application');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := OLE2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
MailItem := OLE2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
var2 := 'Rchirag@covansys.com';
OLE2.SET_PROPERTY(MailItem,'To',var2);
OLE2.SET_PROPERTY(MailItem,'Subject','Auto Mailing on click of a button');
OLE2.SET_PROPERTY(MailItem,'Body', 'hello Chirag '||var1);
Send := OLE2.INVOKE_OBJ(MailItem,'Send');
--destroy objects
OLE2.RELEASE_OBJ(MailItem);
OLE2.RELEASE_OBJ(NameSpace);
OLE2.RELEASE_OBJ(OutlookApp);
END;
|
|
|
|
|
|
|
Re: Sending Emails from Forms6i [message #87117 is a reply to message #85444] |
Tue, 07 December 2004 15:55 |
Louis
Messages: 13 Registered: January 2002
|
Junior Member |
|
|
The following sample code explains how to send email through oracle forms.
The sample code use CmdEmail component to send email, you do not need to
install outlook on your form server.
Requirement: Form server should be running on windows platform.
Please download the free version of CmdEmail from http://www.lv2000.com/sendmail.htm
Louis
DECLARE
v_file_path varchar2(300);
v_sendmail_exe_path varchar2(300);
text_file text_io.file_type;
BEGIN
v_sendmail_exe_path := 'D:sendmailsendmail.exe' ;--TODO: Change the path
v_file_path := 'd:emailmsg.txt' ;--TODO:
text_file:=text_io.fopen(v_file_path,'w');
-- write header
text_io.put_line(text_file,'to:louis@lv2000.com');
text_io.put_line(text_file,'cc:abc@defg.com');
text_io.put_line(text_file,'bcc:hij@klmn.com');
text_io.put_line(text_file,'attachment:c:tempfile1.doc');
text_io.put_line(text_file,'attachment:c:tempfile2.xls');
text_io.put_line(text_file,'subject:Merry Christmas');
text_io.put_line(text_file,'delete_the_file:yes');--delete the message file when the mail is sent successfully.
text_io.put_line(text_file,''); -- delimiter between header and body
-- write body
text_io.put_line(text_file,'first line of the body'||chr(10)||'second line');
text_io.fclose(text_file);
host(v_sendmail_exe_path||' -m:'||v_file_path,NO_SCREEN);
END ;
|
|
|