send email through Form 6i [message #627413] |
Tue, 11 November 2014 13:33 |
|
HZAA
Messages: 13 Registered: November 2014
|
Junior Member |
|
|
did any one try to send email form Form Builder 6i
for Example when click the button send email.
|
|
|
Re: send email through Form 6i [message #627419 is a reply to message #627413] |
Tue, 11 November 2014 15:24 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
its easy to handle in forms 6i to send Email if you need FMB file i can send you.
Declare
Outlook_Object OLE2.OBJ_TYPE;
Mail_Object OLE2.OBJ_TYPE;
Item1 OLE2.OBJ_TYPE;
Item2 OLE2.OBJ_TYPE;
OLEPARAM ole2.list_type;
var_Send OLE2.OBJ_TYPE;
var_Attach1 OLE2.OBJ_TYPE;
var_Attach2 OLE2.OBJ_TYPE;
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE,'BUSY');
Outlook_Object := OLE2.CREATE_OBJ('Outlook.Application');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'MAPI');
Mail_Object := OLE2.INVOKE_OBJ(Outlook_Object,'GetNameSpace',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );
--newMail
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
Item1 := OLE2.INVOKE_OBJ(Outlook_Object,'CreateItem',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );
-- If you want to display outlook new message screen
-- Item2 := OLE2.INVOKE_OBJ(Item1,'Display');
ole2.set_property(Item1,'To',:To);
ole2.set_property(Item1,'Subject',:Subject);
ole2.set_property(Item1,'Body',:Body);
-- If user has selected an attachment then add it with message.
Go_Block('Attachments');
First_Record;
Loop
If :System.Last_Record = 'True' OR :Attachment IS NULL Then
Exit;
Else
var_Attach1 := OLE2.GET_OBJ_PROPERTY(Item1,'Attachments');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,:Attachment);
var_Attach2 := OLE2.INVOKE_OBJ(var_Attach1,'add',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );
End If;
Next_Record;
End Loop;
var_Send := OLE2.INVOKE_OBJ(Item1,'Send');
OLE2.RELEASE_OBJ( Item1);
OLE2.RELEASE_OBJ( Mail_Object );
OLE2.RELEASE_OBJ( Outlook_Object );
SET_APPLICATION_PROPERTY(CURSOR_STYLE,'DEFAULT');
Message('Mail sent seccessfully.........');
Message('Mail sent seccessfully.........');
END;
Regard
Mughal
|
|
|
|
|
|
|
|
|
|
|
|
|
|