Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to Start MAPI Session?

135 views
Skip to first unread message

Alan McKeen

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
We have a Delphi application that successfully generates and sends a
Microsoft Mail message, provided that a MAPI messaging session is already
started.

If a session is not started, the email generation fails, and an error is
returned stating that no current session exists.

How can I start a MAPI messaging session programmatically? We don't want to
require that our users start Outlook before using the program.

Thanks in advance-
Alan

Yorai Aminov (TeamB)

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
On Fri, 19 Mar 1999 13:17:37 -0600, "Alan McKeen"
<Al...@MI-Assistant.com> wrote:

>How can I start a MAPI messaging session programmatically? We don't want to
>require that our users start Outlook before using the program.

You can start a Simple MAPI session using MAPILogon.

---
Yorai Aminov (TeamB)
http://ourworld.compuserve.com/homepages/yaminov
(TeamB cannot answer questions received via email.
To contact me for any other reason remove nospam from my address)

Dave Bolt

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
Alan McKeen wrote:
>
> We have a Delphi application that successfully generates and sends a
> Microsoft Mail message, provided that a MAPI messaging session is already
> started.
>
> If a session is not started, the email generation fails, and an error is
> returned stating that no current session exists.
>
> How can I start a MAPI messaging session programmatically? We don't want to
> require that our users start Outlook before using the program.
>
> Thanks in advance-
> Alan
As Yorai Amino says, you can start a Simple MAPI session with MAPILogon.
I would suggest that you consider trying first to log to any existing
session, then if that fails try to log on to a new session.
You can also use MAPISendMail, make sure you find the help reference
with the C declaration, which is also Simple MAPI. In all cases there is
the option of having a user interface displayed if required to prompt
for things like the Profile Name.
Dave

Alan McKeen

unread,
Mar 23, 1999, 3:00:00 AM3/23/99
to
Could you please provide an *example* of MAPILogon, including the
declarations for any variables passed to the function (like the lplhSession
parameter).

Whenever I call it, I get a return code of 2.

Thanks,
Alan

Yorai Aminov (TeamB) <yam...@nospam.trendline.co.il> wrote in message
news:36f2d924....@forums.inprise.com...


> On Fri, 19 Mar 1999 13:17:37 -0600, "Alan McKeen"
> <Al...@MI-Assistant.com> wrote:
>

> >How can I start a MAPI messaging session programmatically? We don't want
to
> >require that our users start Outlook before using the program.
>

Yorai Aminov (TeamB)

unread,
Mar 23, 1999, 3:00:00 AM3/23/99
to
On Tue, 23 Mar 1999 10:46:20 -0600, "Alan McKeen"
<Al...@MI-Assistant.com> wrote:

>Could you please provide an *example* of MAPILogon, including the
>declarations for any variables passed to the function (like the lplhSession
>parameter).

procedure TForm1.Button1Click(Sender: TObject);
var
Session: THandle;
begin
MAPILogon(Application.Handle, nil, nil, MAPI_LOGON_UI, 0, @Session);
MAPILogoff(Session, 0, 0, 0);
end;

Alan McKeen

unread,
Mar 23, 1999, 3:00:00 AM3/23/99
to
Thank you, Yorai. It works perfectly.

Alan

Yorai Aminov (TeamB) <yam...@nospam.trendline.co.il> wrote in message

news:36f90653...@forums.inprise.com...

0 new messages