Mail with OLE2 (using static mail address for Sender) [message #443124] |
Fri, 12 February 2010 16:27 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kamu
Messages: 5 Registered: September 2008
|
Junior Member |
|
|
Hi,
i can send e-mail with forms using ole2. But i want to use pre-defined e-mail address for SENDER. OLE2 uses outlook account so sender is default account mail address. How can i change sender mail adres on run time.
My code:
DECLARE
OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE;
MailItem 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');
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);
OLE2.SET_PROPERTY(MailItem,'To',:blok01.to);
OLE2.SET_PROPERTY(MailItem,'Cc',:blok01.cc);
OLE2.SET_PROPERTY(MailItem,'Bcc',:blok01.bcc);
OLE2.SET_PROPERTY(MailItem,'Subject',:blok01.subject);
OLE2.SET_PROPERTY(MailItem,'Body', :blok01.body);
Attachments := OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,:blok01.attach1);
Attachment_dummy := OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
Send := OLE2.INVOKE_OBJ(MailItem,'Send');
OLE2.INVOKE(MailItem,'Display');
OLE2.RELEASE_OBJ(MailItem);
OLE2.RELEASE_OBJ(NameSpace);
OLE2.RELEASE_OBJ(OutlookApp);
END;
I want to change SENDER mail address. Is that possible.
Thank you for your helps...
Musti
|
|
|
|
|
Re: Mail with OLE2 (using static mail address for Sender) [message #446928 is a reply to message #443215] |
Thu, 11 March 2010 00:30 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Sorry that I have been so long in replying. Have you solved your problem?
I googled "OLE2.CREATE_OBJ 'Outlook.Application'" and found quite a few entries that purport to send emails via outlook. I can only assume that they use the default email account.
David
|
|
|