Discussion:
Extended MAPI without Outlook
(too old to reply)
Vilius Panevėžys
2007-10-12 18:27:28 UTC
Permalink
Hello,
I have an Extended MAPI application and I need to be able to run it
without Outlook on the system. The app is currently linked with
mapi32.lib and I get the error message "Either there is no default
mail client or the current mail client cannot fulfill the messaging
request. Please run Microsoft Office Outlook and set it
as the default mail client. ", though it functions well on a system
with Outlook installed and set to default. What steps are to be taken
to get the application to run independently from the presence of
Outlook on any particular machine.

Thank you for any guidance.
Vilius Panevėžys
Dmitry Streblechenko
2007-10-12 18:52:01 UTC
Permalink
Install the standalone version of MAPI from
http://www.microsoft.com/downloads/details.aspx?FamilyID=e17e7f31-079a-43a9-bff2-0a110307611e&DisplayLang=en

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vilius Panevezys" <***@stud.ktu.lt> wrote in message news:***@e9g2000prf.googlegroups.com...
Hello,
I have an Extended MAPI application and I need to be able to run it
without Outlook on the system. The app is currently linked with
mapi32.lib and I get the error message "Either there is no default
mail client or the current mail client cannot fulfill the messaging
request. Please run Microsoft Office Outlook and set it
as the default mail client. ", though it functions well on a system
with Outlook installed and set to default. What steps are to be taken
to get the application to run independently from the presence of
Outlook on any particular machine.

Thank you for any guidance.
Vilius Panevezys
Vilius Panevėžys
2007-10-18 15:13:06 UTC
Permalink
Thank you Dmitry, the standalone Exchange client seems to work. That
was a great piece of advice.
However, testing on other machines still fails. I get HRESULT
0x80040111 ( MAPI_E_LOGON_FAILED, I believe) from OpenMsgStore. The
strange thing about this is that I have never seen OpenMsgStore
returning this error on my development machine, moreover the
application works fine on my machine as much as I have tested. But
that's no good as long as it doesn't work on any other machine, even
the one Exchange is running on.
Tested on:
Windows XP/Outlook 2003 - my machine, works great;
Windows XP/ Outlook 2002 - OpenMsgStore: MAPI_E_LOGON_FAILED
Windows 2000 SP4 / standalone MAPI client (the one you've recommended)
- OpenMsgStore: MAPI_E_LOGON_FAILED
Windows 2003 / Exchange - OpenMsgStore: MAPI_E_LOGON_FAILED

I would guess this is some configuration issue, though I wasn't able
to spot any differences.
Maybe you have any idea why could this error arise?

Vilius Panevėžys
Install the standalone version of MAPI fromhttp://www.microsoft.com/downloads/details.aspx?FamilyID=e17e7f31-079...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hello,
I have an Extended MAPI application and I need to be able to run it
without Outlook on the system. The app is currently linked with
mapi32.lib and I get the error message "Either there is no default
mail client or the current mail client cannot fulfill the messaging
request. Please run Microsoft Office Outlook and set it
as the default mail client. ", though it functions well on a system
with Outlook installed and set to default. What steps are to be taken
to get the application to run independently from the presence of
Outlook on any particular machine.
Thank you for any guidance.
Vilius Panevezys
Dmitry Streblechenko
2007-10-18 16:52:49 UTC
Permalink
Where does store entry id come from?
Is your code running under the Windows user identity of the mailbox owner?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vilius Panevezys" <***@stud.ktu.lt> wrote in message news:***@e34g2000pro.googlegroups.com...
Thank you Dmitry, the standalone Exchange client seems to work. That
was a great piece of advice.
However, testing on other machines still fails. I get HRESULT
0x80040111 ( MAPI_E_LOGON_FAILED, I believe) from OpenMsgStore. The
strange thing about this is that I have never seen OpenMsgStore
returning this error on my development machine, moreover the
application works fine on my machine as much as I have tested. But
that's no good as long as it doesn't work on any other machine, even
the one Exchange is running on.
Tested on:
Windows XP/Outlook 2003 - my machine, works great;
Windows XP/ Outlook 2002 - OpenMsgStore: MAPI_E_LOGON_FAILED
Windows 2000 SP4 / standalone MAPI client (the one you've recommended)
- OpenMsgStore: MAPI_E_LOGON_FAILED
Windows 2003 / Exchange - OpenMsgStore: MAPI_E_LOGON_FAILED

I would guess this is some configuration issue, though I wasn't able
to spot any differences.
Maybe you have any idea why could this error arise?

Vilius Panevezys
Post by Dmitry Streblechenko
Install the standalone version of MAPI
fromhttp://www.microsoft.com/downloads/details.aspx?FamilyID=e17e7f31-079...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hello,
I have an Extended MAPI application and I need to be able to run it
without Outlook on the system. The app is currently linked with
mapi32.lib and I get the error message "Either there is no default
mail client or the current mail client cannot fulfill the messaging
request. Please run Microsoft Office Outlook and set it
as the default mail client. ", though it functions well on a system
with Outlook installed and set to default. What steps are to be taken
to get the application to run independently from the presence of
Outlook on any particular machine.
Thank you for any guidance.
Vilius Panevezys
Vilius Panevėžys
2007-10-19 07:07:42 UTC
Permalink
Here is the sequence up to the OpenMsgStore:
hr = MAPILogonEx (NULL, (LPTSTR)szProfile, NULL, MAPI_EXTENDED |
MAPI_NEW_SESSION | MAPI_NO_MAIL | MAPI_LOGON_UI |
MAPI_EXPLICIT_PROFILE /*| MAPI_NT_SERVICE*/, &pSession);
hr = pSession->GetMsgStoresTable(0, &pStoreTable);
hr = HrQueryAllRows(pStoreTable, &sptaEid, &res, NULL, 1, &pRows);
if(pRows->cRows > 0 && pRows->aRow[0].cValues > 0 && pRows-
aRow[0].lpProps[0].ulPropTag == PR_ENTRYID)
{
LPSBinary pEntryId = &pRows->aRow[0].lpProps[0].Value.bin;
hr = pSession->OpenMsgStore(0, pEntryId->cb, (LPENTRYID)pEntryId-
lpb,
&IID_IMsgStore, MAPI_BEST_ACCESS, &pStore);

// ...
}
(of course I omitted everything I thought was irrelevant.)

I've tried running it both ways: logged on as the owner of the mailbox
and other user (this exact case is used with the success scenario,
though I have to enter the credentials to enter the domain).

I'm now quite sure it is a problem with profiles. Here's why:
I managed to get it running by using MAPI_TEMPORARY_PROFILES. And even
that helps only once, i.e. I have to create a new profile at every
rerun of the app. I have no idea why, but the profile that was just
used successfully stops working when I rerun the app. Then I create a
new one using the prompt "Choose Profile"->New... and it runs again.
Furthermore, I have tried to do the same without
MAPI_TEMPORARY_PROFILES. That is I specify an invalid profile name to
get the prompt saying the I must choose another profile. If I choose a
profile that works with MFCMAPI it doesn't work with my app and even
if I create a new one using the prompt it still won't work.
The only working scenario I've found is using the
MAPI_TEMPORARY_PROFILES with MAPIInitialize and creating a new profile
every time.
Unfortunately, I didn't figure out yet what difference does it make
using the temporary *.mmp files for profiles. And even more confusing
is the fact that the temporary profiles work only once. How do they
get corrupted?
Where does store entry id come from?
Is your code running under the Windows user identity of the mailbox owner?
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Thank you Dmitry, the standalone Exchange client seems to work. That
was a great piece of advice.
However, testing on other machines still fails. I get HRESULT
0x80040111 ( MAPI_E_LOGON_FAILED, I believe) from OpenMsgStore. The
strange thing about this is that I have never seen OpenMsgStore
returning this error on my development machine, moreover the
application works fine on my machine as much as I have tested. But
that's no good as long as it doesn't work on any other machine, even
the one Exchange is running on.
Windows XP/Outlook 2003 - my machine, works great;
Windows XP/ Outlook 2002 - OpenMsgStore: MAPI_E_LOGON_FAILED
Windows 2000 SP4 / standalone MAPI client (the one you've recommended)
- OpenMsgStore: MAPI_E_LOGON_FAILED
Windows 2003 / Exchange - OpenMsgStore: MAPI_E_LOGON_FAILED
I would guess this is some configuration issue, though I wasn't able
to spot any differences.
Maybe you have any idea why could this error arise?
Vilius Panevezys
Post by Dmitry Streblechenko
Install the standalone version of MAPI
fromhttp://www.microsoft.com/downloads/details.aspx?FamilyID=e17e7f31-079...
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hello,
I have an Extended MAPI application and I need to be able to run it
without Outlook on the system. The app is currently linked with
mapi32.lib and I get the error message "Either there is no default
mail client or the current mail client cannot fulfill the messaging
request. Please run Microsoft Office Outlook and set it
as the default mail client. ", though it functions well on a system
with Outlook installed and set to default. What steps are to be taken
to get the application to run independently from the presence of
Outlook on any particular machine.
Thank you for any guidance.
Vilius Panevezys
sachin
2010-04-21 09:58:03 UTC
Permalink
HI there,
i am also looking out for the same solution as am also not much known to
mapi but i want to deploy my service on prodcution server where it can read
the mails from profiles.as cause of some policy resctrictions didnt get
outlook installed on server.
have to get any solution for the same problem.

url:http://www.ureader.com/msg/14751223.aspx

Loading...