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

lpMAPISendMail not working FIRST time after install of application

36 views
Skip to first unread message

jaffa...@gmail.com

unread,
Jun 25, 2007, 4:27:30 AM6/25/07
to
Hi,
We're using lpMAPISendMail to send mail from our application.
We're using the default email client configured (outlook/OE) for doing
this, not connecting to a mail server or anything like that.
Our problem is that ONLY the first time, immediately after install
does the mail sending not work; it does not fail, no exceptions are
thrown, etc. What we do get is an error result 26 from lpMAPISendMail.

res = lpMAPISendMail(NULL, (ULONG)GetDesktopWindow(), &Msg,
MAPI_LOGON_UI|MAPI_DIALOG, 0);
fprintf(fp, "Message sending AFTER\n");

if (res == MAPI_E_AMBIGUOUS_RECIPIENT )
fprintf(fp, "Error Code: MAPI_E_AMBIGUOUS_RECIPIENT");
else if (res == MAPI_E_ATTACHMENT_NOT_FOUND )
fprintf(fp, "Error Code: MAPI_E_ATTACHMENT_NOT_FOUND");
else if (res == MAPI_E_ATTACHMENT_OPEN_FAILURE )
fprintf(fp, "Error Code: MAPI_E_ATTACHMENT_OPEN_FAILURE");
else if (res == MAPI_E_BAD_RECIPTYPE )
fprintf(fp, "Error Code: MAPI_E_BAD_RECIPTYPE");
else if (res == MAPI_E_FAILURE )
fprintf(fp, "Error Code: MAPI_E_FAILURE");
else if (res == MAPI_E_INSUFFICIENT_MEMORY )
fprintf(fp, "Error Code: MAPI_E_INSUFFICIENT_MEMORY");
else if (res == MAPI_E_INVALID_RECIPS )
fprintf(fp, "Error Code: MAPI_E_INVALID_RECIPS");
else if (res == MAPI_E_LOGIN_FAILURE )
fprintf(fp, "Error Code: MAPI_E_LOGIN_FAILURE");
else if (res == MAPI_E_TEXT_TOO_LARGE )
fprintf(fp, "Error Code: MAPI_E_TEXT_TOO_LARGE");
else if (res == MAPI_E_TOO_MANY_FILES )
fprintf(fp, "Error Code: MAPI_E_TOO_MANY_FILES");
else if (res == MAPI_E_TOO_MANY_RECIPIENTS )
fprintf(fp, "Error Code: MAPI_E_TOO_MANY_RECIPIENTS");
else if (res == MAPI_E_UNKNOWN_RECIPIENT )
fprintf(fp, "Error Code: MAPI_E_UNKNOWN_RECIPIENT");
else if (res == MAPI_E_USER_ABORT )
fprintf(fp, "Error Code: MAPI_E_USER_ABORT");
else
fprintf(fp, "Result = %ul", res);

and that (I think) comes out as MAPI_E_NOT_SUPPORTED (I'm not sure
whether the value maps like that, but I think I'm right). If this is
the case, why should this problem be occurring? It only happens the
1st time, immediately after install; the rest of the times it works
perfectly.

Lastly, the same code works perfectly well when we start the app. the
2nd time. And this time also we pass the same set of parameters.

Thanks in advance,
regards,
--Jaffar

0 new messages