Home » Developer & Programmer » Forms » Sending Emails from Forms6i in web environment
Sending Emails from Forms6i in web environment [message #85395] Tue, 22 June 2004 06:17 Go to next message
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 #85405 is a reply to message #85395] Wed, 23 June 2004 01:00 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
What utitliy are you using to send mail in cleint-server environment?

Regards
Himanshu
Re: Sending Emails from Forms6i in web environment [message #85406 is a reply to message #85405] Wed, 23 June 2004 01:44 Go to previous messageGo to next message
Chirag
Messages: 7
Registered: December 2001
Junior Member
I am using Microsoft outlook for sending mails.
Re: Sending Emails from Forms6i in web environment [message #85408 is a reply to message #85405] Wed, 23 June 2004 01:53 Go to previous messageGo to next message
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 in web environment [message #85410 is a reply to message #85408] Wed, 23 June 2004 02:56 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
As your Form is running on Middle-tier i.e. your Application server, it may not have access to MS Outlook.

Try to make use of UTL_SMTP.
It will work on WEB also.

HTH
Regards
Himanshu
Re: Sending Emails from Forms6i in web environment [message #85413 is a reply to message #85410] Wed, 23 June 2004 03:51 Go to previous messageGo to next message
Chirag
Messages: 7
Registered: December 2001
Junior Member
But using UTL_SMTP I will be able to send mails only within a domain .
For Eg rchirag@covansys.com to Himanshu@covansys.com

I will like to sent it to Yahoo or Hotmail.

I tried sending from covansys to yahoo, it failed.

If you have tried this earlier then can you send me a sample code which will work across domain.
Re: Sending Emails from Forms6i in web environment [message #85421 is a reply to message #85413] Thu, 24 June 2004 01:53 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Check the following URL.
I posted acode here earlier about how to send Attachments & mails using UTL_SMTP.

http://www.orafaq.com/forum/t/31905/0/

HTH
Himanshu

[Updated on: Fri, 18 February 2005 23:32]

Report message to a moderator

Sending Emails from Forms6i [message #85444 is a reply to message #85395] Sun, 27 June 2004 23:02 Go to previous messageGo to next message
medini
Messages: 1
Registered: June 2004
Junior Member
sir,
i have a button in my canvas. when i click that button, it should send a email .
Re: Sending Emails from Forms6i [message #87117 is a reply to message #85444] Tue, 07 December 2004 15:55 Go to previous message
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 ;

Previous Topic: ORA-03114 Error
Next Topic: HELP! changing a value of a textbox?
Goto Forum:
  


Current Time: Thu Sep 19 03:48:43 CDT 2024