Recent

Author Topic: MAPI library replacement for Lazarus  (Read 4010 times)

LazFun

  • Newbie
  • Posts: 2
MAPI library replacement for Lazarus
« on: May 23, 2017, 01:36:28 pm »
Hello everyone,
I have been using Delphi since 1997 and now I am looking for a way to make some of my apps portable and 64 bit, so I am trying Lazarus (finally!).
I have a quick question, on Win I have been always using MapiSendMail via mapi32.dll because it was there.
I ported some app to Lazarus and Mapi does not seem to work out of the box on Win. What do you guys suggest to use for sending email, that is built into core Lazarus and will be portable to OSes other then Windows? I am familiar with Indy and ICS components. Which one shall I install or anything else? I think I will still have to rewrite the code for email handling on every of my programs, so I would like to choose the most popular solution, not only for email but for another Internet protocols as well. Please give me your $0.02.


marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7796
Re: MAPI library replacement for Lazarus
« Reply #1 on: May 23, 2017, 01:42:54 pm »
indy 10

Thaddy

  • Hero Member
  • *****
  • Posts: 9389
Re: MAPI library replacement for Lazarus
« Reply #2 on: May 23, 2017, 03:26:36 pm »
You may want to look at  https://msdn.microsoft.com/en-us/library/office/dd941355.aspx

The FPC stuff is easily translatable if it hasn't been done yet. Post back. I will do it.

Note that MAPI is not a cross-platform solution.
also related to equus asinus.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8138
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: MAPI library replacement for Lazarus
« Reply #3 on: May 23, 2017, 07:51:29 pm »
If you're familiar with Indy, go with Indy. Otherwise, I suggest looking at lNet (the first letter is small L, not I). Some also love Synapse (michael has an old article specific about email sending with it, while silvio wrote an easy to use unit based on it).

SunyD

  • Guest
Re: MAPI library replacement for Lazarus
« Reply #4 on: May 24, 2017, 12:55:04 am »
You can use Mapi.pas from Delphi also for Lazarus. I am using it.
Compile it in delphi mode (Add after unit Mapi;  this: {$mode delphi} )

But Silvios Xmailer https://github.com/silvioprog/xmailer/ is much better. You don`t need installed email program with it and it is crossplatform. I am switching from mapi to xmailer, it is for the user stressless.
You need for xmailer current ssl-libs from here: http://indy.fulgan.com/SSL/

Thanks Leledumbo for xmailer-link I forget it.



LazFun

  • Newbie
  • Posts: 2
Re: MAPI library replacement for Lazarus
« Reply #5 on: May 24, 2017, 08:11:02 pm »
Thank you for your answers. I suspected recompiling the Delphi mapi wrapper would work, but thanks for confirming. Where easy I will stick to idSMTP for sending email for now EDIT: I Installed Indy in Lazarus and it sents SMTP messages pretty the standard way.

What about ICS components? One of my apps is ICS v.5 based (no SSL, as it was a paid option at the time of writing AFAIR). What path do you suggest? Rewrite to use Indy for portability? What about ICS on Lazarus? I will need to implement SSL in the app one day too...

« Last Edit: May 24, 2017, 11:33:08 pm by LazFun »