OVH Cloud OVH Cloud

Mapi connection without UI dialog

4 réponses
Avatar
Stéphane Craye
I wish to use the function MAPILogon(..) without the option MAPI_LOGON_UI.

If I does not follow currently connected has outlook, this function returns
MAPI_E_FAILURE
ulResult = MAPILogon(0, "MyProfile, "MyPass", MAPI_NEW_SESSION, 0L,
&lhSession)

Someone knows it which is the format of the string "MyProfile" ?

Is this that can use it Mapi without that outlook interactively is launched
?

Can you help me ? Thanks

4 réponses

Avatar
Ken Slovak - [MVP - Outlook]
See http://www.cdolive.com/cdo5.htm#SendMessage for different login
methods for CDO.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


"Stéphane Craye" wrote in message
news:
I wish to use the function MAPILogon(..) without the option
MAPI_LOGON_UI.


If I does not follow currently connected has outlook, this function
returns

MAPI_E_FAILURE
ulResult = MAPILogon(0, "MyProfile, "MyPass", MAPI_NEW_SESSION, 0L,
&lhSession)

Someone knows it which is the format of the string "MyProfile" ?

Is this that can use it Mapi without that outlook interactively is
launched

?

Can you help me ? Thanks





Avatar
Jceel
Bonjour ...Stéphane Craye qui nous as a dit
* I wish to use the function MAPILogon


au cas ou tu ne susses pas FR ça veut dire Français





--
@++++Jceel - MVP Win, I E, Media Player

En vérité je te le dis mais sous O E
internaute indécis pour le HacheuTeuMeuLeu
seul le click droit Control+F deux
la lumière t'apportera C'est ce qu'il y a de mieux
netevangile..selon Jceel.livre du windows.psaume alt-255..verset ÿp
Jceel http://jceel.free.fr l'hyper du gratuit du net
Founding Chairman of the International Pebkac Busters Company

Avatar
Stéphane Craye
' Or, logon using an existing MAPI profile with a new session
objSession.Logon "Profile", "pass", False, True
==>In this case, that be itself in vb or in vb, the connection fails if
I do not post any dialog

' Or, logon using an new MAPI session with a dynamically created profile
strProfileInfo = "server" & vbLf & "mail box"
objSession.Logon "", "", False, True, 0, False, strProfileInfo
'or
objSession.Logon "", "password", False, True, 0, False, strProfileInfo

==>In this case, that be itself in vb or in vb, mapi asks again me the
password !!



"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news:
See http://www.cdolive.com/cdo5.htm#SendMessage for different login
methods for CDO.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


"Stéphane Craye" wrote in message
news:
I wish to use the function MAPILogon(..) without the option
MAPI_LOGON_UI.


If I does not follow currently connected has outlook, this function
returns

MAPI_E_FAILURE
ulResult = MAPILogon(0, "MyProfile, "MyPass", MAPI_NEW_SESSION, 0L,
&lhSession)

Someone knows it which is the format of the string "MyProfile" ?

Is this that can use it Mapi without that outlook interactively is
launched

?

Can you help me ? Thanks









Avatar
Stéphane Craye
Hi

I tried by different method, to connect me without UIdialog an application
MAPI. But my connected It always is to refuse. (With a UI dialog for the
password that walks)

All the examples that I little to find are with a connected existing or with
l'option UI.

Someone to you it more d'info on this problem

See follow some test :

Thanks for your help

/* Simple Mapi test */
hRes = MAPILogon(0, "MyProfile, "MyPass", MAPI_NEW_SESSION, 0L,&lhSession);
...

/* Mapi Ex test */
hRes = MAPIInitialize(NULL);
hRes = MAPILogonEx(0,"MyProfile", "MyPassword", MAPI_NEW_SESSION ,
&lpMAPISession);
...

/* Ole automation test */
CoInitialize(NULL);
_ApplicationPtr objOutlook("Outlook.Application");
pMAPI = objOutlook->GetNamespace("MAPI");
const _variant_t strProfile("MyProfile");
const _variant_t strPassWord("MyPassword");
ulResult = pMAPI->Logon(&strProfile, &strPassWord, VARIANT_FALSE,
VARIANT_TRUE);
...


/* CDO application test *//
CoInitialize(NULL);
VARIANTARG vBoolF;
vBoolF.vt = VT_BOOL;
vBoolF.boolVal = FALSE;
_SessionPtr pSession("MAPI.Session");
strcpy (pstrProfileInfo, "MyServernMyMailBox") ;
pSession->Logon("MyProfile", "MyPassword", vBoolF, vBoolF, vBoolF,
vBoolF, pstrProfileInfo);
...




"Stéphane Craye" a écrit dans le message de news:

I wish to use the function MAPILogon(..) without the option MAPI_LOGON_UI.

If I does not follow currently connected has outlook, this function
returns

MAPI_E_FAILURE
ulResult = MAPILogon(0, "MyProfile, "MyPass", MAPI_NEW_SESSION, 0L,
&lhSession)

Someone knows it which is the format of the string "MyProfile" ?

Is this that can use it Mapi without that outlook interactively is
launched

?

Can you help me ? Thanks