` Printed Icetips Article

Icetips Article



Email, FTP etc.: MAPI compared to SMTP
2003-08-08 -- Gus M. Creces
 
Newsgroups: TopSpeed.Topic.Third_Party

Here's my experience - from the perspective of someone who uses both MAPI
and SMTP.
Each has a place and a reason for being.

MAPI has been around for quite some time. It's mainly a MS standard which MS
themselves don't always follow.

The idea of MAPI is that your application can control the MAPI-compliant
email client on your computer in order to send and receive emails. There is
a standardized set of (M)API calls that allow you to do this. 4-5 years ago
when our toolkit introduced MAPI classes and templates we did an extensive
survey to ascertain MAPI compliancy for various email clients out there. We
found various levels of compliancy, with only the MS products Outlook and
Outlook Express working 100 percent reliably and storing registry values in
a consistent way so that it was easy to determine which client was
installed, etc. etc.

Since MS has gone on it's security-above-all kick they've basically made
Outlook (I don't mean Outlook Express) totally useless as a MAPI client. It
still works but is a pain in the butt to use because of the nags that come
up and can't easily be made to go away. While Outlook used to work really
well via MAPI, I've been telling our users for over a year now to avoid it
like the plague if they possibly can.

Outlook Express, on the other hand, is - an continues to be - a marvellous
MAPI client and you can make it jump through hoops. Now to all those MAPI
nay sayers let's use a little imagination. So you don't use OE and nor do
your customers, you say.  Ergo you're MAPI dead in the water, you say.
Consider that Outlook Express these days is really part of the operating
system. Just like Internet Explorer is part of the operating system. Despite
what the US Justice Department would have you believe. You have to work hard
NOT to get it installed with your XP or Win2K installations. Since it's
almost defacto nowadays, it's there whether you or your clients use it or
not. And it can be utilized by your applications for sending and receiving
purposes. Despite what you've been told, a MAPI email client is no harder
(or no easier) to configure than an SMTP client. In fact, the information
required to make either one work is identical - SMTP server and local email
address (for outgoing), POP server (if you want incoming) and Email account
name, and email account password (again to satisfy incoming mail
requirements).

If OE already has one or more email accounts set up, your MAPI program can
present a list of them to the user and ask which should be used, or it can
simply be made to use the default account. That being the case, your user
needs to do nothing to make your email work application work. If OE does not
have any accounts set up you have to provide instructions on how to
configure one or more OE accounts or you can simply pop up a Clarion dialog
window the way you would have to anyway for an SMTP configuration, and
collect the necessary email account information, drop it in the registry for
OE to use and you're off to the races. OE does not have to be your default
email client. It's easy enough to determine the default email client when
your app does its thing, swap it out for OE, do your thing with OE, and swap
it back. All of this could be done even with an existing default email
client running in the foreground or background.

So, to review, since O.E. is essentially a part of the operating system, you
can rely on it to be there, and warn if it isn't. You can configure it, and
use it in the background (or foreground) the way you use other operating
system features, DLLs and API's. It can send and receive and redirect as
necessary. It logs all incoming and outgoing mail for you at no extra
programming cost to you. (unlike SMTP) We've even figured out how to make it
into an email scrubber and how to make bulk mailings (where we don't
necessarily want every outgoing mail item logged into your outbox) go away.
Because it's also a NNTP newsgroup client you can treat newgroup messages
just as if they were mail, vetting, scrubbing, massaging them into standard
data bases. All this power comes built-in.

The CHT toolkit also has an SMTP implementation. SMTP has some advantages
when it comes to transport-style email and structured, HTML-style mail. But
configuration wise, it's no easier to get up and running than MAPI. In fact,
where we're presenting an SMTP configuation dialog, we generally look at the
Registry to see if Outlook or OE don't already have an account set up that
lists the SMTP server and local email address and we present that as a
starting point.

Which methodology you use is really tied the intended outcome required by
your application. Sometimes it's just a matter of personal preference. I use
both depending on intended use.

Cheers...

--
Gus M. Creces
The Clarion Handy Tools Page
http://www.cwhandy.ca
http://news.cwhandy.ca
gcreces@sympatico.ca




"Jono Woodhouse"  wrote in message
news:3f2944de@news.softvelocity.com...
Hi

I'm wanting to add something about the Pros and Cons of MAPI and SMTP into
one of our FAQs. So I thought it would be good to open this up for public
discussion, comments, and improvements.

As you can see I've got more of a bend towards SMTP than MAPI, so I'm
looking for some more thoughts on MAPI in particular.

Thanks
Jono


----------------------------------------------------------------------------
----


Question: What's the difference between SMTP and MAPI Email Sending? Which
one is better?

Answer: The answer to this question really lies in what you are trying to
do. Below is a list of Pros and Cons for each, which should help you make a
good decision.

MAPI Pros:

  a.. Can interface directly into the users Inbox and Outbox.
MAPI Cons:

  a.. Not all email clients support MAPI. (For example some of the earlier
versions of Outlook Express didn't support it). Does anyone know if Netscape
Mail, Eudora, Pegasus support MAPI.
  b.. Outlook Express 5.0 and younger require you to turn on MAPI in their
settings.
  c.. Different versions of Windows support different versions of MAPI.
  d.. You may have no control as to what email client your customers are
going to be running.
  e.. If your application gets run on a server, there is no guarantee that a
email client is installed on the server machine.
  f.. If Betty in the office decides she's going to change her email client
to Eudora v2.07, your application will not be able to detect this?
  g.. What happens if Tom decides to re-install Windows and suddenly your
application stops sending email.
  h.. If you are writing a multi-user application (i.e. server and EXE sit
in one place, many workstations run the application), you could end up with
a situation where some workstations can send emails and others can't.
  i.. Some people don't like emails being added to their outbox. (Specially
if it's a bulk email application that sends out 500MB of emails)
  j.. Some folk don't want an application changing the emails in your Inbox,
marking messages as read, deleting messages etc. (For example: My PDA can
talk with MAPI software on my PC. If I look at a message in my PDA it marks
the message as read in my Inbox (plus there is no way in my PDA to mark it
unread again). Further more it will delete the message in my Inbox if I
delete the email in my PDA. I get tons of emails, but only want a few in my
PDA.)
MAPI Solutions:

  a..
SMTP Pros:

  a.. Completely independent of the user's email client. (You can of course
send emails that can read be read in email clients and receive emails that
were written in an email client).
  b.. Sends email directly to or from an SMTP Server.
  c.. In a multi-user environment, you only have to setup your email
settings once on the server, and then no matter how many changes there are
to the workstations email clients, windows versions your application keeps
working.
SMTP Cons:

  a.. You application has to send email to an SMTP Server, this can be
achieved easily if:
  -  your clients run an email server
  - your application dials in to their ISP
  - or you install the CapeSoft Email Server or the royalty free Developer
Edition (which means your app doesn't have to handle Dial-Up and can send at
any time of day or night).
  This is not as bad as it sounds as everyone who runs email has to be
sending/receiving email from an email server somehow, so it's just a matter
of getting your application to connect to the Email Server.
  b.. You need to tell your application the address of the Email Server (We
should be adding a control template sometime that makes a Email Settings
Wizard in your application).
SMTP Solutions:

  a.. NetTalk supports SMTP, so it's easy to add sending & receiving to your
application.
  b.. Plus you can use CapeSoft's Email Server or the royalty free Developer
Edition to stay completely independent of your client's system.

----------------------------------------------------------------------------
----


Excellent article!
2003-08-11 � Arnor Baldvinsson
This is an excellent article on on the pros and cons of the SMTP and MAPI mail protocols.

Arnor


Printed November 21, 2024, 12:11 pm
This article has been viewed/printed 35501 times.
Google search has resulted in 1407 hits on this article since January 25, 2004.