Article View: borland.public.cppbuilder.nativeapi
Article #10193mapisendmail : mapi_e_failure under outlook
From: Ludo
Date: Mon, 03 May 2004 16:08
Date: Mon, 03 May 2004 16:08
93 lines
3265 bytes
3265 bytes
Hi,
I have developed an application who send emails with the mapi interface.
When my program is run with outlook express or netscape for the
default mail client, everything is ok. But when my program is run with
outlook, I receive an error : "MAPI_E_FAILURE". However, MAPILogon is
passed with success. I don't understand.
thanks for your help, regards,
Ludo
my code :
(mail_trace is a little function for my trace with a MessageBox)
...
ULONG result ;
MapiMessage stMessage ;
MapiRecipDesc stFrom ;
HINSTANCE hInstMail = NULL ;
LPMAPISENDMAIL fnSendMail = NULL ;
LPMAPILOGON fnMAPILogon = NULL ;
LPMAPILOGOFF fnMAPILogoff = NULL ;
LHANDLE hSession = NULL;
fnMAPILogon = (LPMAPILOGON) GetProcAddress(hInstMail, "MAPILogon");
fnSendMail = (LPMAPISENDMAIL) GetProcAddress(hInstMail, "MAPISendMail");
fnMAPILogoff = (LPMAPILOGOFF) GetProcAddress(hInstMail, "MAPILogoff");
result = fnMAPILogon(NULL,NULL,NULL,MAPI_LOGON_UI ,0,&hSession) ;
if (result != SUCCESS_SUCCESS)
{
mail_trace ("MAPI LOGON FAILED") ;
ok = false ;
}
if (ok)
{
result = fnSendMail(hSession, (ULONG) Application->Handle,
&stMessage, MAPI_LOGON_UI, 0);
switch (result)
{
case SUCCESS_SUCCESS:
error_message = "SUCCESS_SUCCESS";
break;
case MAPI_E_AMBIGUOUS_RECIPIENT:
error_message = "MAPI_E_AMBIGUOUS_RECIPIENT";
break;
case MAPI_E_ATTACHMENT_NOT_FOUND:
error_message = "MAPI_E_ATTACHMENT_NOT_FOUND";
break;
case MAPI_E_ATTACHMENT_OPEN_FAILURE:
error_message = "MAPI_E_ATTACHMENT_OPEN_FAILURE";
break;
case MAPI_E_BAD_RECIPTYPE:
error_message = "MAPI_E_BAD_RECIPTYPE";
break;
case MAPI_E_FAILURE:
error_message = "MAPI_E_FAILURE";
break;
case MAPI_E_INSUFFICIENT_MEMORY:
error_message = "MAPI_E_INSUFFICIENT_MEMORY";
break;
case MAPI_E_LOGIN_FAILURE:
error_message = "MAPI_E_LOGIN_FAILURE";
break;
case MAPI_E_TEXT_TOO_LARGE:
error_message = "MAPI_E_TEXT_TOO_LARGE";
break;
case MAPI_E_TOO_MANY_FILES:
error_message = "MAPI_E_TOO_MANY_FILES";
break;
case MAPI_E_TOO_MANY_RECIPIENTS:
error_message = "MAPI_E_TOO_MANY_RECIPIENTS" ;
break;
case MAPI_E_UNKNOWN_RECIPIENT:
error_message = "MAPI_E_UNKNOWN_RECIPIENT" ;
break;
case MAPI_E_USER_ABORT:
error_message = "MAPI_E_USER_ABORT" ;
break;
default:
error_message = "MAPI_UNKNOWN_ERROR" ;
break;
} ;
mail_trace (error_message) ;
fnMAPILogoff(hSession, NULL, NULL, NULL) ;
} // if ok
Technical Details
Message-ID:
<40966e97$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ad4c5139f6b99e7f,start X-Google-Attributes: gid10cc67,public Date: Mon, 03 May 2004 18:08:46 +0200 From: Ludo <inthebluelagoon@yahoo.fr> User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: mapisendmail : mapi_e_failure under outlook Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 212.234.48.103 Message-ID: <40966e97$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1083600535 212.234.48.103 (3 May 2004 09:08:55 -0700) Lines: 93 Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail