Embarcadero Tech Partner WINSOFT provides an easy to use MAPI suite for Delphi.
What makes MAPI hard?
MAPI is hard. There is lack of clear and consistent coding, different answers provide different solutions, the solution is not in Delphi, there has to be various work-arounds, or the code-snipplet was built for very old non-Unicode version of Delphi. You eventually tear your hair out or get exasperated with partial or non-working solutions.
C#, VB.NET users are left out in the cold: if you look around, using MAPI in C# is out of the question as you’ll get all kind of errors as, Extended MAPI is not supported for use with .NET
MAPI is supported in native-languages, such as C++ Builder and Delphi.
MAPI is an interface for, nearly all email clients on the Windows platform. TheBat – an independent email client, ThunderBird – the FireFox competitor to Outlook, HCL Lotus Notes (formerly IBM, formerly Lotus Notes) and Outlook.
MAPI works in both 32-bit and 64-bits, and is installed on Windows 10 as 64-bit MAPI, with 32-bit MAPI compatible DLL.
Installation
Steps:
- Go to https://www.winsoft.sk/smapi.htm for the download link
- Download the trial version
- Unzip smapi.zip
Simple MAPI Demonstration
I will send an email with attachment.
The code-behind the form, is less than 10 lines:
1 2 3 4 5 6 7 8 9 10 11 12 |
begin with SMapiSendMail do begin SendTo := EditTo.Text; Cc := EditCc.Text; Subject := EditSubject.Text; Body.Assign(MemoBody.Lines); Send; end; ShowMessage('Message was sent'); end; |
And successfully sends an email via Outlook:
The code attaches an email to be sent, with attachment.
Make Winsoft’s Simple MAPI Component Suite part of your Delphi arsenal.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition
Interesting, works @ Win10 but unfortunately is useless for Windows 11 (which I have)
or is there any solution for this problem?
Yes, this article was written four years ago and a few things have changed since then.
You can use the details in the following StackOverflow article to send email with MAPI in Delphi on Windows 11: https://stackoverflow.com/questions/76669925/delphi-mapisendmail-returns-mapi-e-user-abort