Re: SMTP vs. MAPI

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nick Malik (nickmalik_at_hotmail.nospam.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 05:39:58 GMT


>>> Unfornately with the AF we are prohibited from using SMTP unless I can
come up with a case why we need to.<<<

then why ask?

OK... you need a case:
1) SMTP is easier to code against. There are classes built in to the
framework to support SMTP. They are debugged and easy to use. To call MAPI
requires COM calls that are difficult to learn and use. SMTP will take
about 30 minutes to learn to use... MAPI will take hours or days to code
and, due to the complexity of the code, is more likely to require debugging
and bug fixes. Your project will save a couple of days of total effort in
development.

2) SMTP is simple to install. To use MAPI requires a connection with
Exchange server... This requires an involved install procedure, since the
user that the account runs against has to log in to the machine to create
the initial profile. In addition, office components have to be installed on
the server (specifically, Outlook). This bears complexity and limits
flexibility. In the case where your site is popular and you need to set up
another server, or where you are doing disaster recovery, the complexity of
setup will slow down deployment SIGNIFICANTLY. It could be the difference
between a 15 minute install and an hour-long install. In a server-down
situation, that's the difference between three 9's and four 9's for the
year.

3) Installation of MAPI components on the server requires maintenance of an
outlook license on the server (I'm not completely sure of this... this used
to be the case, but I haven't tried to install MAPI on a server in a couple
of years... you may want to verify that this is still true). Outlook is an
office component. This costs money to purchase and requires management
overhead to insure that the correct license is purchased and installed. The
headache and cost are usually a very strong factor in selecting away from
MAPI on the server.

4) There is nothing that you can do in outbound mail using MAPI that you
cannot also do in SMTP, in an easier fashion. SMTP provides the ability to
send formatted e-mail, in Text, HTML or RTF or any other MIME type, complete
with embedded attachments. You can do the same in MAPI, but it's a bit
harder to do.

5) MAPI requires exchange server. If the exchange server is not available,
your MAPI components will fail to work. SMTP send can use a local SMTP
server that is set to forward to your company's exchange SMTP gateway. This
means that when Exchange is down, your app is still able to send e-mail.
(The outbound mail will sit and wait for exchange to come back up without
blocking the server.) The workaround is to set up a clustered Exchange
environment, which is overkill just to support a web application.

6) Many more resources exist to assist a developer or support analyst if you
use SMTP. This is actually bigger than most managers think. No one works
in a vacuum. We all rely on assistance, whether it is from this NG, or
articles in magazines, or books, conferences, white papers, web sites, etc.
You will find two orders of magnitude more useful, hands-on information
about using SMTP to solve the problems than using MAPI. This leads to less
frustration and ease with which the assignment of development and support
tasks can rotate from one developer to another without extra training. In
other words, no need to rely on the guru.

7) Microsoft uses SMTP for their own products. Look at Sharepoint: the
ability to send e-mail is with SMTP, not MAPI. Same goes for Biztalk. Same
goes for nearly every tool except SQL Server and Outlook itself. Even
Outlook Express is designed to work SMTP and POP3.

8) SMTP is the internet standard for sending e-mail. MAPI is not.
Standards matter.

If that isn't enough of a case, I don't know what is.

This does not mean that I am opposed to MAPI. If you are READING e-mail, or
need to communicate with Exchange for something other than creating and
sending e-mail (like traversing folders, checking permissions, opening and
using forms, communicating with calendars and meeting requests, etc), then
MAPI is good... However, for 99% of all uses on a web server, which
involves sending e-mail, use SMTP.

Hope this helps,
--- Nick Malik
      Solutions Architect
      MCSD, CFPS, Certified Scrummaster

"Mike Moore" <MikeMoore@discussions.microsoft.com> wrote in message
news:5A6C7DC1-D11A-45AD-B4CC-AFD3E90B0908@microsoft.com...
> Unfornately with the AF we are prohibited from using SMTP unless I can
come
> up with a case why we need to.
>
> Any other ways to do it?
>
> "Nick Malik" wrote:
>
> > If you are sending e-mail from a server, SMTP is about five times easier
to
> > code then MAPI.
> >
> > MAPI is a technology designed for client-server implementations... it
runs
> > best on the client site although I've seen it implemented on the server.
> > However it is memory expensive and not terribly fast. If all you are
doing
> > is sending e-mail, and not reading a mailbox, I would strongly suggest
that
> > you stick with SMTP.
> >
> > --- Nick Malik
> >
> > "Mike Moore" <MikeMoore@discussions.microsoft.com> wrote in message
> > news:46FBE886-F1B9-4EC9-AF1A-BD5872DBDE32@microsoft.com...
> > > We are designing an asp.net application. We need to generate an email
> > that
> > > contains information on the webform and allow our customers to add to
the
> > > email message. We are looking at using SMTP or MAPI right now. Which
is
> > > better or does anyone else have a better suggestion?
> >
> >
> >



Relevant Pages

  • [NT] Vulnerability in Exchange Server Could Allow Arbitrary Code Execution (MS03-046)
    ... Get your security news from a reliable source. ... In Exchange Server 5.5, a security vulnerability exists in the Internet ... an unauthenticated attacker to connect to the SMTP port on an Exchange ...
    (Securiteam)
  • RE: SMTP error (only from Outlook)
    ... This issue appeared on specify user or all SMTP clients? ... If yes, in Exchange System ... Is there any local bridgehead server listed in "Local ... to over three dozen open relay block lists. ...
    (microsoft.public.windows.server.sbs)
  • RE: strange email errors
    ... you to check the relay configuration on the SBS server. ... please restart the SMTP virtue server and Exchange ... Please also refer to the following steps to create a new SMTP Connector to ...
    (microsoft.public.windows.server.sbs)
  • Re: Exchange issues
    ... Are you up to date on all your Service Packs, both Windows and Exchange? ... > all traffic on port 25 to the SBS Exhange server. ... I suspected SMTP relaying becuase ... > You should verify that the server really isn't an open relay: ...
    (microsoft.public.exchange2000.admin)
  • Filtering email on ISA
    ... Unless you choose to create a new IIS SMTP Virtual ... Server, ordinarily you will want to Server Publish ... directly to the Exchange SMTP, ...
    (microsoft.public.isa)