Thursday, March 3, 2011

Solution for Developer 2000

Do you know ? how to send mail with D2K form6i.
















use these code and get solution 100%.

DECLARE

  objOutlook OLE2.OBJ_TYPE;
  objMail OLE2.OBJ_TYPE;
  objArg OLE2.LIST_TYPE;
BEGIN
  objOutlook := OLE2.CREATE_OBJ('Outlook.Application');
  objarg := OLE2.CREATE_ARGLIST;
  OLE2.ADD_ARG(objarg,0);
  objMail := OLE2.INVOKE_OBJ(objOutlook,'CreateItem',objarg);
  OLE2.DESTROY_ARGLIST(objarg);

  OLE2.SET_PROPERTY(objmail,'To',:TO);
  OLE2.SET_PROPERTY(objmail,'Subject',:SUBJECT);
  OLE2.SET_PROPERTY(objmail,'Body',:BODY);

  OLE2.INVOKE(objmail,'Send');
  OLE2.INVOKE(objmail,'Display');
  OLE2.RELEASE_OBJ(objmail);
  OLE2.RELEASE_OBJ(objOutlook);
Message('Your mail sent successfully..............');
Message('Your mail sent successfully..............');
END;

No comments:

Post a Comment