|
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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
|
|
|
|
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 Go to previous message](/forum/theme/orafaq/images/up.png) |
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"."
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 3281 times)
|
|
|