summaryrefslogtreecommitdiff
path: root/shell/source/win32/simplemail/smplmailclient.cxx
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-10-15 09:50:05 +0000
committerTino Rachui <tra@openoffice.org>2001-10-15 09:50:05 +0000
commit426e0d498f3d60f5784702227967e22b211922ed (patch)
tree9537785ce39558743eea335cd934128b7d76f099 /shell/source/win32/simplemail/smplmailclient.cxx
parent557c9f3ca912833f20c24f507f42eb48b675467a (diff)
#93077#now using an existing session and ignoring the flag NO_LOGON_DIALOG else we may run into trouble when using Outlook (not Outlook Express), see comment for file smplmailsuppl.cxx
Diffstat (limited to 'shell/source/win32/simplemail/smplmailclient.cxx')
-rw-r--r--shell/source/win32/simplemail/smplmailclient.cxx27
1 files changed, 22 insertions, 5 deletions
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx
index 16368a8dd345..afff5f4fd272 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: smplmailclient.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: tra $ $Date: 2001-05-25 08:21:23 $
+ * last change: $Author: tra $ $Date: 2001-10-15 10:50:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -133,9 +133,21 @@ namespace // private
//
//------------------------------------------------
-CSmplMailClient::CSmplMailClient( ) :
+CSmplMailClient::CSmplMailClient( LHANDLE hMapiSession ) :
+ m_hMapiSession( hMapiSession ),
m_pSimpleMapi( CSimpleMapi::create( ) )
{
+ OSL_ASSERT( m_hMapiSession );
+}
+
+//------------------------------------------------
+//
+//------------------------------------------------
+
+CSmplMailClient::~CSmplMailClient( )
+{
+ ULONG ulRet = m_pSimpleMapi->MAPILogoff( m_hMapiSession, 0, 0, 0 );
+ OSL_ASSERT( SUCCESS_SUCCESS == ulRet );
}
//------------------------------------------------
@@ -166,16 +178,18 @@ void SAL_CALL CSmplMailClient::sendSimpleMailMessage( const Reference< XSimpleMa
initMapiSendMailFlags( aFlag, flFlags );
ULONG ulRet = m_pSimpleMapi->MAPISendMail(
- 0, // no session, create a new one
+ m_hMapiSession, // we use an existing session #93077#
0, // no parent window
&mapiMsg, // a configured mapi message struct
flFlags, // some flags
0 ); // reserved
if ( SUCCESS_SUCCESS != ulRet )
+ {
throw Exception(
getMapiErrorMsg( ulRet ),
static_cast< XSimpleMailClient* >( this ) );
+ }
}
catch( RuntimeException& )
{
@@ -390,7 +404,10 @@ void CSmplMailClient::initAttachementList(
void CSmplMailClient::initMapiSendMailFlags( sal_Int32 aFlags, FLAGS& aMapiFlags )
{
- aMapiFlags = MAPI_NEW_SESSION | MAPI_UNICODE;
+ // #93077#
+ OSL_ASSERT( !( aFlags & NO_LOGON_DIALOG ), "Flag NO_LOGON_DIALOG has currently no effect" );
+
+ aMapiFlags = MAPI_UNICODE; // #93077# MAPI_NEW_SESSION
if ( !( aFlags & NO_USER_INTERFACE ) )
aMapiFlags |= MAPI_DIALOG;