Hi.
I have a program that I am trying to send e-mails through. I am using MAPI to send the message. I have the code as follows:
The code works fine sending the e-mail, however, when I close the program, the following error message appears:
Does anyone know how I could prevent this from happening?
Thanks,
British
I have a program that I am trying to send e-mails through. I am using MAPI to send the message. I have the code as follows:
Code:
MAPIModule := LoadLibrary(PChar(MAPIDLL));
if MAPIModule=0
then
begin
Result := -1
end
else
begin
try
@SM := GetProcAddress(MAPIModule, 'MAPISendMail');
if @SM <> nil
then
begin
Result := mapiSendMail( 0, application.Handle, msg, MAPI_LOGON_UI, 0 );
end
else
begin
Result := 1
end;
finally
FreeLibrary(MAPIModule);
end;
end;
The code works fine sending the e-mail, however, when I close the program, the following error message appears:
Code:
Project Theatre.exe reaised exception class EAccessViolation with message 'Access violation at address 7649F877. Read of address 7649F877.' Process stopped.
Does anyone know how I could prevent this from happening?
Thanks,
British