unit main;
interface
uses
Windows
, Dialogs
,
MAPI
;
function MAPILogon(ulUIParam: Cardinal; lpszProfileName: LPSTR; lpszPassword: LPSTR; flFlags: FLAGS; ulReserved: Cardinal; lplhSession: PLHANDLE): Cardinal;
stdcall;
function MapiLogOff(lhSession: LHANDLE; ulUIParam: Cardinal; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;
stdcall;
function MapiSendMail(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;
stdcall;
function MapiSendDocuments(ulUIParam: Cardinal; lpszDelimChar: LPSTR; lpszFilePaths: LPSTR; lpszFileNames: LPSTR; ulReserved: Cardinal): Cardinal;
stdcall;
function MapiFindNext(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszMessageType: LPSTR; lpszSeedMessageID: LPSTR; flFlags: FLAGS;
ulReserved: Cardinal; lpszMessageID: LPSTR): Cardinal;
stdcall;
function MapiReadMail(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszMessageID: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;
var lppMessage: PMapiMessage): Cardinal;
stdcall;
function MapiSaveMail(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal;
lpszMessageID: LPSTR): Cardinal;
stdcall;
function MapiDeleteMail(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszMessageID: LPSTR; flFlags: FLAGS;
ulReserved: Cardinal): Cardinal;
stdcall;
function MapiFreeBuffer(pv: Pointer): Cardinal;
stdcall;
function MapiAddress(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszCaption: LPSTR; nEditFields: Cardinal; lpszLabels: LPSTR;
nRecips: Cardinal;
var lpRecips: TMapiRecipDesc; flFlags: FLAGS;
ulReserved: Cardinal; lpnNewRecips: PULONG;
var lppNewRecips: PMapiRecipDesc): Cardinal;
stdcall;
function MapiDetails(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpRecip: TMapiRecipDesc; flFlags: FLAGS;
ulReserved: Cardinal): Cardinal;
stdcall;
function MapiResolveName(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszName: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;
var lppRecip: PMapiRecipDesc): Cardinal;
stdcall;
function GetMapiDllVersion : Cardinal;
stdcall;
implementation
//******************************************************************************
//******************************************************************************
function GetMapiDllVersion : Cardinal;
stdcall;
begin
MessageBeep(0);
ShowMessage('
GetDLLVersion');
Result := 97;
end;
function MAPILogon(ulUIParam: Cardinal; lpszProfileName: LPSTR; lpszPassword: LPSTR; flFlags: FLAGS; ulReserved: Cardinal; lplhSession: PLHANDLE): Cardinal;
stdcall;
begin
MessageBeep(0);
ShowMessage('
Logon');
Result := SUCCESS_SUCCESS
end;
function MapiLogOff(lhSession: LHANDLE; ulUIParam: Cardinal; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;
stdcall;
begin
MessageBeep(0);
ShowMessage('
Logoff');
Result := SUCCESS_SUCCESS
end;
function MapiSendMail(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;
stdcall;
begin
// ShowMessage('SendMail');
SendMAPIMail(lpMessage);
Result := 1;
end;
function MapiSendDocuments(ulUIParam: Cardinal; lpszDelimChar: LPSTR;
lpszFilePaths: LPSTR; lpszFileNames: LPSTR; ulReserved: Cardinal): Cardinal;
stdcall;
begin
// MessageBeep(0);
{
ShowMessage('SendDocuments : Deli : "'+lpszDelimChar+'"'+#13+#10+
'FilePAth : "'+lpszFilePaths+'"'+#13+#10+
'lpszFileNames : "'+lpszFileNames+'"'
);
}
SendMAPIDocuments(lpszDelimChar, lpszFilePaths, lpszFileNames);
Result := SUCCESS_SUCCESS;
end;
function MapiFindNext(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszMessageType: LPSTR; lpszSeedMessageID: LPSTR; flFlags: FLAGS;
ulReserved: Cardinal; lpszMessageID: LPSTR): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiReadMail(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszMessageID: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;
var lppMessage: PMapiMessage): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiSaveMail(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal;
lpszMessageID: LPSTR): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiDeleteMail(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszMessageID: LPSTR; flFlags: FLAGS;
ulReserved: Cardinal): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiFreeBuffer(pv: Pointer): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiAddress(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszCaption: LPSTR; nEditFields: Cardinal; lpszLabels: LPSTR;
nRecips: Cardinal;
var lpRecips: TMapiRecipDesc; flFlags: FLAGS;
ulReserved: Cardinal; lpnNewRecips: PULONG;
var lppNewRecips: PMapiRecipDesc): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiDetails(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpRecip: TMapiRecipDesc; flFlags: FLAGS;
ulReserved: Cardinal): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
function MapiResolveName(lhSession: LHANDLE; ulUIParam: Cardinal;
lpszName: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;
var lppRecip: PMapiRecipDesc): Cardinal;
begin
Result := MAPI_E_FAILURE;
end;
end.