Thread View: borland.public.cppbuilder.multimedia
1 messages
1 total messages
Started by Mauro
Tue, 14 May 2002 06:21
Hi! I need help for TMapiMessage!
Author: Mauro
Date: Tue, 14 May 2002 06:21
Date: Tue, 14 May 2002 06:21
58 lines
2905 bytes
2905 bytes
Hi. I wrote this code for sending mails with TMapiMessage.
All works perfectly, but error is equal 0 also if I canceled the dialog box.
It returns always SUCCESS_SUCCESS instead of MAPI_E_USER_ABORT.
May some one know why??
I am using it with BCB6
Thanks for every suggestion!
Mauro
Follow code:
//************************
TMapiMessage Messaggio;
Cardinal Errore;
TMapiRecipDesc destinatario;
destinatario.ulReserved = NULL;
destinatario.ulRecipClass = MAPI_TO;
destinatario.lpszName = "NYL";
destinatario.lpszAddress = "sapere@tin.it";
destinatario.ulEIDSize = NULL;
destinatario.lpEntryID= NULL;
TMapiFileDesc allegato;
allegato.ulReserved = NULL;
//allegato.flFlags = NULL;
allegato.nPosition = (Cardinal)(0xFFFFFFFF);
//char st[255];
//sprintf (st, "%s\\%s", GetCurrentDir().c_str(), meseRif.c_str());
String st;
st.sprintf("%s\\%s", GetCurrentDir(), meseRif);
allegato.lpszPathName = st.c_str();
allegato.lpszFileName = NULL;
String nome = "Tariffazione periodo "+eMese->Text;
Messaggio.ulReserved = 0;
Messaggio.lpszSubject = nome.c_str();
Messaggio.lpszNoteText = "Ciao";
Messaggio.lpszMessageType = NULL;
Messaggio.lpszDateReceived = NULL;
Messaggio.lpszConversationID = NULL;
Messaggio.flFlags = 0;
Messaggio.lpOriginator = NULL;
Messaggio.nRecipCount = 1;
Messaggio.lpRecips = &destinatario;
Messaggio.nFileCount = 1;
Messaggio.lpFiles = &allegato;
Errore = MapiSendMail(0, reinterpret_cast<unsigned
int>(Application->Handle),
Messaggio, MAPI_LOGON_UI | MAPI_NEW_SESSION, 0); //MAPI_DIALOG |
if (!Errore)
Application->MessageBox("La tariffazione � stata inoltrata con
cuccesso!", "Tariffazione", MB_OK | MB_ICONEXCLAMATION);
else Application->MessageBox("Non � stato possibile inoltrare la
tariffazione!", "Tariffazione", MB_OK | MB_ICONINFORMATION);
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads