Home » Developer & Programmer » Forms » Sending a mail with an attachment from Oracle forms6i
Sending a mail with an attachment from Oracle forms6i [message #80102] Sun, 11 August 2002 22:19 Go to next message
Victoria
Messages: 152
Registered: July 2002
Senior Member
Hi,
I need to send an email with attachment(.xls) to couple of users(in 'Cc' list).Anyone please suggest me a way out....

Its really urgent.Pls help me
Thanks in advance
V

__________________
Thanks & Regards
Victoria
Re: Sending a mail with an attachment from Oracle forms6i [message #80103 is a reply to message #80102] Sun, 11 August 2002 22:27 Go to previous messageGo to next message
Subhash
Messages: 105
Registered: October 2001
Senior Member
Use OLE for this..
Am attaching the code

PROCEDURE email (v_to in varchar2, v_cc in varchar2,
v_bcc in varchar2, v_body in varchar2,
v_subject in varchar2,v_attach in varchar2) IS

OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE; -- documents collection
Folders OLE2.OBJ_TYPE;
MailItem OLE2.OBJ_TYPE;
MailItem2 OLE2.OBJ_TYPE;
OLEPARAM ole2.list_type;
Send OLE2.OBJ_TYPE;
Attachments OLE2.OBJ_TYPE;
Attachment_dummy OLE2.OBJ_TYPE;

BEGIN

OutlookApp := OLE2.CREATE_OBJ('Outlook.Application');

-- Create a namespace
-- Think of this as the equivalent as the Documents Collection
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := OLE2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );

--Create a newMail Object
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
MailItem := OLE2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );

ole2.set_property(MailItem,'To',v_to);
ole2.set_property(MailItem,'CC',v_cc);
ole2.set_property(MailItem,'BCC',v_bcc);
ole2.set_property(MailItem,'Subject',v_subject);
ole2.set_property(MailItem,'Body',v_body);

Attachments := OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
--Adding an attachment
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,v_attach);
Attachment_dummy := OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );

Send := OLE2.INVOKE_OBJ(Mailitem,'Send');

OLE2.RELEASE_OBJ( MailItem);
OLE2.RELEASE_OBJ( NameSpace );
OLE2.RELEASE_OBJ( OutlookApp );

Message('Mail send successfully...');

Exception
When others then
Message('Mail not send...');

END;
Re: Sending a mail with an attachment from Oracle forms6i [message #80578 is a reply to message #80102] Wed, 16 October 2002 13:38 Go to previous messageGo to next message
Peter Clamp
Messages: 1
Registered: October 2002
Junior Member
Some of our users have permissions to use the "From" field in Outlook to send email from special accounts associated with particular business functions. They would like to be able to trigger email messages from our Forms 6i application using these special accounts where appropriate. Is there an equivalent to
ole2.set_property(MailItem,'To',v_to);
that puts a value in the "From" field of an Outlook email? What parameter in single quotes should I use to do this?
Any help with this would be gratefully received.
Thanks,
Peter Clamp
Oracle forms6i [message #80959 is a reply to message #80102] Tue, 17 December 2002 23:48 Go to previous messageGo to next message
narayan ghimire
Messages: 3
Registered: December 2002
Junior Member
please send me the documentaion of developer 6i
with regards
narayan ghimire
kathmandu
nepal
Re: Sending a mail with an attachment from Oracle forms6i [message #121440 is a reply to message #80103] Sun, 29 May 2005 08:55 Go to previous message
Gurusubramanyam
Messages: 79
Registered: July 2001
Member
Hi Subhash ,

Thanks a lot for shring your ideas. The code which you have provided is really handy. Aport from that I want share another information.

When we generate the mails using outlook from forms we may get the outlook security alert saying that

"A program is trying to automatically send e-mail on your behalf. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No"."

/forum/fa/188/0/



This is very much frustrating and to get rid of that,Please download the free utility "Express ClickYes" from the folowing site to get rid of the following message

Link:

http://www.contextmagic.com/express-clickyes/

Hope this will be helpful.

Thanks & Regards,
G.S



  • Attachment: Message.jpg
    (Size: 14.87KB, Downloaded 3237 times)
Previous Topic: how to execute dynamic query what is the syntax
Next Topic: FRM-41003
Goto Forum:
  


Current Time: Wed Sep 18 21:27:25 CDT 2024