🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #875

Hi! I need help for TMapiMessage!

#875
From: Mauro
Date: Tue, 14 May 2002 06:21
58 lines
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);
Technical Details
Message-ID: <r12E8.56911$5k4.1255378@twister2.libero.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!newsfeed.wirehub.nl!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10d0fc,9dbc531b55329c06,start
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2002-05-13 23:21:12 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!newsfeed.wirehub.nl!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail
From: "Mauro" <mauro.rolly@libero.it>
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Hi! I need help for TMapiMessage!
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <r12E8.56911$5k4.1255378@twister2.libero.it>
Date: Tue, 14 May 2002 08:21:00 +0200
NNTP-Posting-Host: 151.38.221.95
X-Complaints-To: abuse@net24.it
X-Trace: twister2.libero.it 1021357271 151.38.221.95 (Tue, 14 May 2002 08:21:11 MET DST)
NNTP-Posting-Date: Tue, 14 May 2002 08:21:11 MET DST
Organization: [Infostrada]